@@ -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