Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit e6faea4

Browse files
committed
wip
1 parent ee91058 commit e6faea4

File tree

2 files changed

+106
-105
lines changed

2 files changed

+106
-105
lines changed

tests/index.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import { describe } from 'manten';
22
import { createNode } from './utils/node-with-loader.js';
33

44
const nodeVersions = [
5-
'20',
5+
// '20',
66
...(
77
(
88
process.env.CI
99
&& process.platform !== 'win32'
1010
)
1111
? [
1212
'12.20.0', // CJS named export detection added
13-
'12',
14-
'14',
15-
'16',
16-
'17',
17-
'18',
13+
// '12',
14+
// '14',
15+
// '16',
16+
// '17',
17+
// '18',
1818
]
1919
: []
2020
),
@@ -26,36 +26,36 @@ const nodeVersions = [
2626
describe('Package: module', async ({ runTestSuite }) => {
2727
const node = await createNode(nodeVersion, './tests/fixtures/package-module');
2828

29-
runTestSuite(
30-
import('./specs/javascript/index.js'),
31-
node,
32-
);
33-
runTestSuite(
34-
import('./specs/typescript/index.js'),
35-
node,
36-
);
29+
// runTestSuite(
30+
// import('./specs/javascript/index.js'),
31+
// node,
32+
// );
33+
// runTestSuite(
34+
// import('./specs/typescript/index.js'),
35+
// node,
36+
// );
3737
runTestSuite(
3838
import('./specs/json.js'),
3939
node,
4040
);
41-
runTestSuite(
42-
import('./specs/wasm.js'),
43-
node,
44-
);
45-
runTestSuite(
46-
import('./specs/data.js'),
47-
node,
48-
);
49-
runTestSuite(
50-
import('./specs/import-map.js'),
51-
node,
52-
);
41+
// runTestSuite(
42+
// import('./specs/wasm.js'),
43+
// node,
44+
// );
45+
// runTestSuite(
46+
// import('./specs/data.js'),
47+
// node,
48+
// );
49+
// runTestSuite(
50+
// import('./specs/import-map.js'),
51+
// node,
52+
// );
5353
});
5454

55-
runTestSuite(
56-
import('./specs/package-cjs.js'),
57-
await createNode(nodeVersion, './tests/fixtures/package-commonjs'),
58-
);
55+
// runTestSuite(
56+
// import('./specs/package-cjs.js'),
57+
// await createNode(nodeVersion, './tests/fixtures/package-commonjs'),
58+
// );
5959
});
6060
}
6161
})();

tests/specs/json.ts

Lines changed: 76 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -19,88 +19,89 @@ export default testSuite(async ({ describe }, node: NodeApis) => {
1919
onFinish(async () => await fixture.rm());
2020

2121
describe('full path', ({ test }) => {
22-
test('Load', async () => {
23-
const nodeProcess = await node.loadFile(fixture.path, './index.json');
24-
expect(nodeProcess.exitCode).toBe(0);
25-
expect(nodeProcess.stdout).toBe('');
26-
});
22+
// test('Load', async () => {
23+
// const nodeProcess = await node.loadFile(fixture.path, './index.json');
24+
// expect(nodeProcess.exitCode).toBe(0);
25+
// expect(nodeProcess.stdout).toBe('');
26+
// });
2727

28-
test('Import', async () => {
29-
const nodeProcess = await node.importFile(fixture.path, './index.json');
30-
expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
31-
});
28+
// test('Import', async () => {
29+
// const nodeProcess = await node.importFile(fixture.path, './index.json');
30+
// expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
31+
// });
3232

3333
test('Import with query', async () => {
3434
const nodeProcess = await node.importFile(fixture.path, `./index.json${query}`);
35+
console.log(nodeProcess);
3536
expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
3637
});
3738
});
3839

39-
describe('extensionless', ({ test }) => {
40-
test('Load', async () => {
41-
const nodeProcess = await node.loadFile(fixture.path, './index');
42-
expect(nodeProcess.exitCode).toBe(0);
43-
expect(nodeProcess.stdout).toBe('');
44-
});
45-
46-
test('Import', async () => {
47-
const nodeProcess = await node.importFile(fixture.path, './index');
48-
expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
49-
});
50-
51-
test('Import with query', async () => {
52-
const nodeProcess = await node.importFile(fixture.path, `./index${query}`);
53-
expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
54-
});
55-
});
56-
57-
describe('directory', ({ test }) => {
58-
test('Load', async () => {
59-
const nodeProcess = await node.loadFile(fixture.path, '.');
60-
expect(nodeProcess.exitCode).toBe(0);
61-
expect(nodeProcess.stdout).toBe('');
62-
});
63-
64-
test('Import', async () => {
65-
const nodeProcess = await node.importFile(fixture.path, '.');
66-
expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
67-
});
68-
69-
test('Import with query', async () => {
70-
const nodeProcess = await node.importFile(fixture.path, `./${query}`);
71-
expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
72-
});
73-
});
74-
75-
describe('ambiguous path', async ({ describe, onFinish }) => {
76-
const fixture = await createFixture({
77-
...jsonFixture,
78-
index: {
79-
file: '',
80-
},
81-
});
82-
83-
onFinish(async () => await fixture.rm());
84-
85-
describe('ambiguous path to directory should fallback to file', async ({ test }) => {
86-
test('Load', async () => {
87-
const nodeProcess = await node.loadFile(fixture.path, './index');
88-
expect(nodeProcess.exitCode).toBe(0);
89-
expect(nodeProcess.stdout).toBe('');
90-
});
91-
92-
test('Import', async () => {
93-
const nodeProcess = await node.importFile(fixture.path, './index');
94-
expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
95-
});
96-
});
97-
98-
describe('explicit directory should not fallback to file', ({ test }) => {
99-
test('Import', async () => {
100-
const nodeProcess = await node.importFile(fixture.path, './index/');
101-
expect(nodeProcess.stderr).toMatch('ERR_MODULE_NOT_FOUND');
102-
});
103-
});
104-
});
40+
// describe('extensionless', ({ test }) => {
41+
// test('Load', async () => {
42+
// const nodeProcess = await node.loadFile(fixture.path, './index');
43+
// expect(nodeProcess.exitCode).toBe(0);
44+
// expect(nodeProcess.stdout).toBe('');
45+
// });
46+
47+
// test('Import', async () => {
48+
// const nodeProcess = await node.importFile(fixture.path, './index');
49+
// expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
50+
// });
51+
52+
// test('Import with query', async () => {
53+
// const nodeProcess = await node.importFile(fixture.path, `./index${query}`);
54+
// expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
55+
// });
56+
// });
57+
58+
// describe('directory', ({ test }) => {
59+
// test('Load', async () => {
60+
// const nodeProcess = await node.loadFile(fixture.path, '.');
61+
// expect(nodeProcess.exitCode).toBe(0);
62+
// expect(nodeProcess.stdout).toBe('');
63+
// });
64+
65+
// test('Import', async () => {
66+
// const nodeProcess = await node.importFile(fixture.path, '.');
67+
// expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
68+
// });
69+
70+
// test('Import with query', async () => {
71+
// const nodeProcess = await node.importFile(fixture.path, `./${query}`);
72+
// expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
73+
// });
74+
// });
75+
76+
// describe('ambiguous path', async ({ describe, onFinish }) => {
77+
// const fixture = await createFixture({
78+
// ...jsonFixture,
79+
// index: {
80+
// file: '',
81+
// },
82+
// });
83+
84+
// onFinish(async () => await fixture.rm());
85+
86+
// describe('ambiguous path to directory should fallback to file', async ({ test }) => {
87+
// test('Load', async () => {
88+
// const nodeProcess = await node.loadFile(fixture.path, './index');
89+
// expect(nodeProcess.exitCode).toBe(0);
90+
// expect(nodeProcess.stdout).toBe('');
91+
// });
92+
93+
// test('Import', async () => {
94+
// const nodeProcess = await node.importFile(fixture.path, './index');
95+
// expect(nodeProcess.stdout).toMatch('default: { loaded: \'json\' }');
96+
// });
97+
// });
98+
99+
// describe('explicit directory should not fallback to file', ({ test }) => {
100+
// test('Import', async () => {
101+
// const nodeProcess = await node.importFile(fixture.path, './index/');
102+
// expect(nodeProcess.stderr).toMatch('ERR_MODULE_NOT_FOUND');
103+
// });
104+
// });
105+
// });
105106
});
106107
});

0 commit comments

Comments
 (0)