Skip to content

Commit

Permalink
Fix wasm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Nov 4, 2024
1 parent 15fc604 commit 86a6cd3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"scripts": {
"prebuild": "prebuildify --napi --strip --tag-libc",
"format": "prettier --write \"./**/*.{js,json,md}\"",
"build": "node-gyp rebuild -j 8 --debug --verbose",
"build": "node-gyp rebuild",
"install": "node scripts/build-from-source.js",
"test": "mocha"
},
Expand Down
8 changes: 5 additions & 3 deletions test/since.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const watcherNative = require('../');
const assert = require('assert');
const fs = require('fs-extra');
const path = require('path');

let watcher = watcherNative;
let watcherWasm;
let watcher;
let watcherWasm, watcherNative;

const snapshotPath = path.join(__dirname, 'snapshot.txt');
const tmpDir = path.join(
Expand Down Expand Up @@ -62,6 +61,9 @@ describe('since', () => {
}
watcher = watcherWasm;
} else {
if (!watcherNative) {
watcherNative = require('../');
}
watcher = watcherNative;
}
});
Expand Down
6 changes: 4 additions & 2 deletions test/watcher.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const watcherNative = require('../');
const assert = require('assert');
const fs = require('fs-extra');
const path = require('path');
const {execSync} = require('child_process');
const {Worker} = require('worker_threads');

let watcher = watcherNative;
let watcher, watcherNative;

let backends = [];
if (process.platform === 'darwin') {
Expand Down Expand Up @@ -61,6 +60,9 @@ describe('watcher', () => {
if (backend === 'wasm') {
watcher = await import('../wasm/index.mjs');
} else {
if (!watcherNative) {
watcherNative = require('../');
}
watcher = watcherNative;
}

Expand Down

0 comments on commit 86a6cd3

Please sign in to comment.