diff options
author | Alon Zakai <azakai@google.com> | 2024-02-08 11:19:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-08 11:19:24 -0800 |
commit | f09af77ce103add9d60b656d8bd7e995120dc54e (patch) | |
tree | 3c89c61b3bf93d3d8da043c3754d1fa19f6cdfbb /test/unit/input/asyncify.js | |
parent | 6e1e53f093a92177405d59a6733bfe3e57a5b877 (diff) | |
download | binaryen-f09af77ce103add9d60b656d8bd7e995120dc54e.tar.gz binaryen-f09af77ce103add9d60b656d8bd7e995120dc54e.tar.bz2 binaryen-f09af77ce103add9d60b656d8bd7e995120dc54e.zip |
Add package.json for unit tests (#6245)
The JS there is not an ES6 module, so declare it so (otherwise a package.json in a
parent, perhaps in folders outside of our own project that we are pasted in, can
cause an error, as require does not work in ES6 modules and we might be forced
to be seen as one).
Fixes #6240
Diffstat (limited to 'test/unit/input/asyncify.js')
-rw-r--r-- | test/unit/input/asyncify.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/unit/input/asyncify.js b/test/unit/input/asyncify.js index 0dcd87302..28e82d296 100644 --- a/test/unit/input/asyncify.js +++ b/test/unit/input/asyncify.js @@ -3,6 +3,9 @@ function assert(x, y) { if (!x) throw (y || 'assertion failed') + '\n' + new Error().stack; } +// This is the reason we have a package.json file alongside us, to tell node +// that we are not an ES6 module (as a parent directory might have one with +// type: "module" which would then cause breakage). var fs = require('fs'); function sleepTests() { |