diff options
author | 2021-09-23 22:01:34 -0700 | |
---|---|---|
committer | 2021-09-23 22:01:34 -0700 | |
commit | 4bb41b95a826892107b7ff3ff610d23d5afa96b6 (patch) | |
tree | 439f273d09ae8fa845eaec24c9e436c8fd244be3 /integration/snapshots/lodash-regexp.hmr.js | |
parent | f78f4854a4e474a08023841f4714f0cd3774126b (diff) | |
download | bun-4bb41b95a826892107b7ff3ff610d23d5afa96b6.tar.gz bun-4bb41b95a826892107b7ff3ff610d23d5afa96b6.tar.zst bun-4bb41b95a826892107b7ff3ff610d23d5afa96b6.zip |
:camera:
Diffstat (limited to 'integration/snapshots/lodash-regexp.hmr.js')
-rw-r--r-- | integration/snapshots/lodash-regexp.hmr.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/integration/snapshots/lodash-regexp.hmr.js b/integration/snapshots/lodash-regexp.hmr.js new file mode 100644 index 000000000..cd9ca40f7 --- /dev/null +++ b/integration/snapshots/lodash-regexp.hmr.js @@ -0,0 +1,41 @@ +import { +__require as require +} from "http://localhost:8080/__runtime.js"; +import { +__HMRModule as HMR +} from "http://localhost:8080/__runtime.js"; +import { +__HMRClient as Bun +} from "http://localhost:8080/__runtime.js"; +import * as $60f52dc2 from "http://localhost:8080/node_modules/lodash/lodash.js"; +var { shuffle} = require($60f52dc2); +Bun.activate(false); + +var hmr = new HMR(2158065009, "lodash-regexp.js"), exports = hmr.exports; +(hmr._load = function() { + function test() { + const foo = [1, 2, 3, 4, 6]; + const bar = shuffle(foo); + console.assert(bar !== foo); + console.assert(bar.length === foo.length); + bar.sort(); + foo.sort(); + for (let i = 0;i < bar.length; i++) { + console.assert(bar[i] === foo[i], "expected " + i + " to be " + foo[i]); + console.assert(typeof bar[i] === "number"); + console.assert(typeof foo[i] === "number"); + } + return testDone(import.meta.url); + } + hmr.exportAll({ + test: () => test + }); +})(); +var $$hmr_test = hmr.exports.test; +hmr._update = function(exports) { + $$hmr_test = exports.test; +}; + +export { + $$hmr_test as test +}; |