Slide 12
Slide 12 text
• JestMochaɺVitestͳͲͱ
ಉ͡ه๏ͰςετΛॻ͘͜
ͱ͕Ͱ͖Δ
• ωετ͢Δ͜ͱՄೳ
• εΩοϓTodoɺonlyɺ
timeoutͷઃఆͳͲՄೳ
• v22Ͱplan()͕Ճ͞ΕͯΞ
αʔγϣϯͷ࣮ߦճݕ
ࠪͰ͖ΔΑ͏ʹͳͬͨ
import { describe, it } from ‘node:test';
import assert from ‘node:assert';
describe('A thing', () => {
it('should work', () => {
assert.strictEqual(1, 1);
});
it('should be ok', () => {
assert.strictEqual(2, 2);
});
describe('a nested thing', () => {
it('should work', () => {
assert.strictEqual(3, 3);
});
});
it.skip(‘should be skipped', () => {
assert.strictEqual(2, 2);
});
it.todo(‘should be written later');
it(‘should be passed as planned', (t) => {
t.plan(2);
t.assert.strictEqual(2, 2);
t.assert.ok(1 === 1);
});
});