diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-11-18 22:54:20 -0800 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-11-19 01:54:20 -0500 |
commit | e73a82dc42b3d80bea42482e227c31e5ef01e273 (patch) | |
tree | 5c3f26bc19d4ce6b3e42b2fe48f47e1cccbb29fd /std/node/tests/cjs | |
parent | e6fdb2628fdeeae0c7b06c25214b2edba96364dd (diff) |
feat(std/node) add CommonJS require (#3380)
Diffstat (limited to 'std/node/tests/cjs')
-rw-r--r-- | std/node/tests/cjs/cjs_a.js | 10 | ||||
-rw-r--r-- | std/node/tests/cjs/cjs_b.js | 5 | ||||
-rw-r--r-- | std/node/tests/cjs/cjs_cycle_a.js | 3 | ||||
-rw-r--r-- | std/node/tests/cjs/cjs_cycle_b.js | 3 | ||||
-rw-r--r-- | std/node/tests/cjs/subdir/cjs_c.js | 1 |
5 files changed, 22 insertions, 0 deletions
diff --git a/std/node/tests/cjs/cjs_a.js b/std/node/tests/cjs/cjs_a.js new file mode 100644 index 000000000..b8f69c857 --- /dev/null +++ b/std/node/tests/cjs/cjs_a.js @@ -0,0 +1,10 @@ +/* eslint-disable */ +const { helloB } = require("./cjs_b.js"); +const C = require("./subdir/cjs_c"); +const leftPad = require("left-pad"); + +function helloA() { + return "A"; +} + +module.exports = { helloA, helloB, C, leftPad }; diff --git a/std/node/tests/cjs/cjs_b.js b/std/node/tests/cjs/cjs_b.js new file mode 100644 index 000000000..17499012c --- /dev/null +++ b/std/node/tests/cjs/cjs_b.js @@ -0,0 +1,5 @@ +function helloB() { + return "B"; +} + +module.exports = { helloB }; diff --git a/std/node/tests/cjs/cjs_cycle_a.js b/std/node/tests/cjs/cjs_cycle_a.js new file mode 100644 index 000000000..7a4e5a5f6 --- /dev/null +++ b/std/node/tests/cjs/cjs_cycle_a.js @@ -0,0 +1,3 @@ +module.exports = false; +require("./cjs_cycle_a"); +module.exports = true; diff --git a/std/node/tests/cjs/cjs_cycle_b.js b/std/node/tests/cjs/cjs_cycle_b.js new file mode 100644 index 000000000..d85a1fc84 --- /dev/null +++ b/std/node/tests/cjs/cjs_cycle_b.js @@ -0,0 +1,3 @@ +module.exports = false; +require("./cjs_cycle_b"); +module.exports = true; diff --git a/std/node/tests/cjs/subdir/cjs_c.js b/std/node/tests/cjs/subdir/cjs_c.js new file mode 100644 index 000000000..4e7d7ebe5 --- /dev/null +++ b/std/node/tests/cjs/subdir/cjs_c.js @@ -0,0 +1 @@ +module.exports = "C"; |