@param {import('tap').Test} assert
(assert)
| 59 | |
| 60 | /** @param {import('tap').Test} assert */ |
| 61 | async function testModuleEntryPoints (assert) { |
| 62 | const directory = createPackageFixture(assert) |
| 63 | writePackage(join(directory, 'same-version'), version) |
| 64 | writePackage(join(directory, 'other-version'), '0.0.0-test') |
| 65 | for (const name of ['first', 'second']) { |
| 66 | writeFileSync(join(directory, `${name}.cjs`), "module.exports = require('safe-stable-stringify')\n") |
| 67 | writeFileSync(join(directory, `${name}.mjs`), "export { default, configure, stringify } from 'safe-stable-stringify'\n") |
| 68 | } |
| 69 | |
| 70 | const results = await Promise.all([ |
| 71 | runNode(['modules.cjs', 'require-first'], { cwd: directory }), |
| 72 | runNode(['modules.cjs', 'import-first'], { cwd: directory }) |
| 73 | ]) |
| 74 | for (const { stdout, stderr } of results) { |
| 75 | assert.equal(stdout, '', 'no output') |
| 76 | assert.equal(stderr, '', 'no errors') |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | test('module entry points share exports across consumers and load orders', testModuleEntryPoints) |
| 81 |
nothing calls this directly
no test coverage detected