File
Blob: src/workerd/api/tests/commonjs-module-test.js
| 1 | // Copyright (c) 2024 Cloudflare, Inc. |
| 2 | // Licensed under the Apache 2.0 license found in the LICENSE file or at: |
| 3 | // https://opensource.org/licenses/Apache-2.0 |
| 4 | import { foo, bar, default as baz } from 'foo'; |
| 5 | import * as fooModule from 'foo'; |
| 6 | import { strictEqual } from 'node:assert'; |
| 7 | |
| 8 | export const test = { |
| 9 | test() { |
| 10 | strictEqual(fooModule.default, baz); |
| 11 | strictEqual(fooModule.foo, foo); |
| 12 | strictEqual(fooModule.bar, undefined); |
| 13 | strictEqual(foo, 1); |
| 14 | strictEqual(bar, undefined); |
| 15 | strictEqual(baz.foo, foo); |
| 16 | }, |
| 17 | }; |