import fs from 'node:fs';
describe('Description of test file 1', () => {
test('Test on file1', () => {
expect(true).toBeTruthy();
// run the code to create result file.
// test that result file.
});
});
import fs from 'node:fs';
describe('Description of test file 2', () => {
test('Test on file2', () => {
expect(false).toBeFalsy();
// use result file from file1.test to do another tests
// after end of tests in this file (file2.test) I can use after to delete file.
});
});
выше IS file2.test.mjs .
Я хочу убедиться, что file2.test.mjs выполняется после file1.test.mjs .>
В Phpunit есть функция тестовых зависимостей, но в шутку я не вижу такого. (Весь проект node.js находится в «Тип»: «Модуль» .) [code]import fs from 'node:fs';
describe('Description of test file 1', () => { test('Test on file1', () => { expect(true).toBeTruthy(); // run the code to create result file. // test that result file. }); }); [/code] выше [b] file1.test.mjs [/b]. [code]import fs from 'node:fs';
describe('Description of test file 2', () => { test('Test on file2', () => { expect(false).toBeFalsy(); // use result file from file1.test to do another tests // after end of tests in this file (file2.test) I can use after to delete file. }); }); [/code] выше IS [b] file2.test.mjs [/b]. Я хочу убедиться, что [b] file2.test.mjs [/b] выполняется после [b] file1.test.mjs [/b].>