-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
47 lines (41 loc) · 1.12 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import test from 'bron';
import assert from 'assert';
import mock from 'mock-fs';
import { readFileSync } from 'fs';
import { join } from 'path';
import { factory, runTasks } from 'release-it/test/util/index.js';
import ExpoBumperPlugin from './index.js';
mock({
'app.json': JSON.stringify({
expo: {
version: '1.0.0',
android: {
versionCode: 1
},
ios: {
buildNumber: '1'
}
}
})
});
const namespace = '@mwillbanks/release-it-expo-bumper-plugin';
const options = { [namespace]: {} };
test('should increment the Android version code, iOS build number, and app version', async () => {
// Set up the release-it configuration
const plugin = factory(ExpoBumperPlugin, { namespace, options });
// Run the bump task
await runTasks(plugin, ['bump']);
// Verify that the app.json file was updated correctly
const updatedAppJson = JSON.parse(readFileSync(join(process.cwd(), 'app.json'), 'utf8'));
assert.deepEqual(updatedAppJson, {
expo: {
version: '1.0.1',
android: {
versionCode: 2
},
ios: {
buildNumber: '2'
}
}
});
});