Как сделать шутку в зависимости от другого теста?Javascript

Форум по Javascript
Anonymous
Как сделать шутку в зависимости от другого теста?

Сообщение Anonymous »

В Phpunit есть функция тестовых зависимостей, но в шутку я не вижу такого. (Весь проект node.js находится в «Тип»: «Модуль» .)

Код: Выделить всё

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.
});
});
выше file1.test.mjs .

Код: Выделить всё

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

Подробнее здесь: https://stackoverflow.com/questions/797 ... other-test

Вернуться в «Javascript»