Skip to content

Commit 4b27285

Browse files
committed
Switch all functions to run synchronously
1 parent 9ddc8df commit 4b27285

File tree

2 files changed

+318
-205
lines changed

2 files changed

+318
-205
lines changed

src/index.test.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ import {
77
} from '.';
88

99
describe('Tests', () => {
10-
test('hasNativeVersion true', async () => {
11-
const isNative = await hasNativeVersion(Platform.all, 'src/testdata/node_modules/native-module');
10+
test('hasNativeVersion true', () => {
11+
const isNative = hasNativeVersion(Platform.all, 'src/testdata/node_modules/native-module');
1212

1313
expect(isNative).toBe(true);
1414
});
1515

16-
test('hasNativeVersion false', async () => {
17-
const isNative = await hasNativeVersion(Platform.all, 'src/testdata/node_modules/js-module');
16+
test('hasNativeVersion false', () => {
17+
const isNative = hasNativeVersion(Platform.all, 'src/testdata/node_modules/js-module');
1818

1919
expect(isNative).toBe(false);
2020
});
2121

22-
test('getModules', async () => {
23-
const modules = await getModules('src/testdata');
22+
test('getModules', () => {
23+
const modules = getModules('src/testdata');
2424

2525
expect(modules).toEqual<Module[]>([
2626
{
@@ -106,41 +106,41 @@ describe('Tests', () => {
106106
]);
107107
});
108108

109-
test('isGitDirty', async () => {
110-
const isIt = await isGitDirty('.');
109+
test('isGitDirty', () => {
110+
const isIt = isGitDirty('.');
111111
expect(isIt).toBe(false);
112112
});
113113

114-
test('getCurrentHash', async () => {
115-
const hash = await getCurrentHash(Platform.all, { rootDir: path.join(__dirname, 'testdata'), verbose: true });
114+
test('getCurrentHash', () => {
115+
const hash = getCurrentHash(Platform.all, { rootDir: path.join(__dirname, 'testdata'), verbose: true });
116116

117117
expect(hash).toEqual('b98c0e5d9ff15b1ca98d7aa3d09ebe39');
118118
});
119119

120-
test('verifyLibrary true', async () => {
121-
const { hasChanged, valueExists } = await verifyLibrary({ rootDir: `${__dirname}/testdata/node_modules/android-module-with-hash`, verbose: true });
120+
test('verifyLibrary true', () => {
121+
const { hasChanged, valueExists } = verifyLibrary({ rootDir: `${__dirname}/testdata/node_modules/android-module-with-hash`, verbose: true });
122122

123123
expect(hasChanged).toBe(false);
124124
expect(valueExists).toBe(true);
125125
}, 10000);
126126

127-
test('verifyLibrary without hash', async () => {
128-
const { hasChanged, valueExists } = await verifyLibrary({ rootDir: `${__dirname}/testdata/node_modules/android-module`, verbose: true });
127+
test('verifyLibrary without hash', () => {
128+
const { hasChanged, valueExists } = verifyLibrary({ rootDir: `${__dirname}/testdata/node_modules/android-module`, verbose: true });
129129

130130
expect(hasChanged).toBe(false);
131131
expect(valueExists).toBe(false);
132132
}, 10000);
133133

134-
test('verifyLibrary with faulty hash', async () => {
135-
const { hasChanged, valueExists } = await verifyLibrary({ rootDir: `${__dirname}/testdata/node_modules/native-module-with-faulty-hash`, verbose: true });
134+
test('verifyLibrary with faulty hash', () => {
135+
const { hasChanged, valueExists } = verifyLibrary({ rootDir: `${__dirname}/testdata/node_modules/native-module-with-faulty-hash`, verbose: true });
136136

137137
expect(hasChanged).toBe(true);
138138
expect(valueExists).toBe(true);
139139
}, 10000);
140140

141-
test('readPackageJson', async () => {
142-
const jsModuleVersion = await readPackageJson('src/testdata/node_modules/js-module');
143-
const nativeModuleVersion = await readPackageJson('src/testdata/node_modules/native-module');
141+
test('readPackageJson', () => {
142+
const jsModuleVersion = readPackageJson('src/testdata/node_modules/js-module');
143+
const nativeModuleVersion = readPackageJson('src/testdata/node_modules/native-module');
144144

145145
expect(jsModuleVersion.version).toEqual('0.0.1');
146146
expect(jsModuleVersion.nativeDependencyHash).toEqual(undefined);

0 commit comments

Comments
 (0)