Skip to content

Commit 86a6cd3

Browse files
committed
Fix wasm tests
1 parent 15fc604 commit 86a6cd3

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"scripts": {
3232
"prebuild": "prebuildify --napi --strip --tag-libc",
3333
"format": "prettier --write \"./**/*.{js,json,md}\"",
34-
"build": "node-gyp rebuild -j 8 --debug --verbose",
34+
"build": "node-gyp rebuild",
3535
"install": "node scripts/build-from-source.js",
3636
"test": "mocha"
3737
},

test/since.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
const watcherNative = require('../');
21
const assert = require('assert');
32
const fs = require('fs-extra');
43
const path = require('path');
54

6-
let watcher = watcherNative;
7-
let watcherWasm;
5+
let watcher;
6+
let watcherWasm, watcherNative;
87

98
const snapshotPath = path.join(__dirname, 'snapshot.txt');
109
const tmpDir = path.join(
@@ -62,6 +61,9 @@ describe('since', () => {
6261
}
6362
watcher = watcherWasm;
6463
} else {
64+
if (!watcherNative) {
65+
watcherNative = require('../');
66+
}
6567
watcher = watcherNative;
6668
}
6769
});

test/watcher.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
const watcherNative = require('../');
21
const assert = require('assert');
32
const fs = require('fs-extra');
43
const path = require('path');
54
const {execSync} = require('child_process');
65
const {Worker} = require('worker_threads');
76

8-
let watcher = watcherNative;
7+
let watcher, watcherNative;
98

109
let backends = [];
1110
if (process.platform === 'darwin') {
@@ -61,6 +60,9 @@ describe('watcher', () => {
6160
if (backend === 'wasm') {
6261
watcher = await import('../wasm/index.mjs');
6362
} else {
63+
if (!watcherNative) {
64+
watcherNative = require('../');
65+
}
6466
watcher = watcherNative;
6567
}
6668

0 commit comments

Comments
 (0)