Skip to content

Commit f65a16d

Browse files
committed
WIP: snapshot
1 parent aca0c00 commit f65a16d

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

__tests__/snapshot.test.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as junit2json from '../src/index.ts'
22
import * as fs from 'node:fs'
33
import * as path from 'node:path'
4-
import { describe, it } from 'node:test';
5-
import assert from 'node:assert/strict';
4+
import { describe, it, test } from 'node:test';
65
import { fileURLToPath } from 'node:url';
76

87
const __filename = fileURLToPath(import.meta.url);
@@ -13,31 +12,31 @@ const fixturePath = (fixtureName: string) => {
1312
}
1413

1514
describe('parse snapshot', () => {
16-
it('all success xml', async () => {
15+
test('all success xml', async (t) => {
1716
const xml = fs.readFileSync(fixturePath('jest-success.xml'))
1817
const parsed = await junit2json.parse(xml)
1918

20-
assert.snapshot(parsed, { description: 'all success xml snapshot' });
19+
t.assert.snapshot(parsed);
2120
})
2221

23-
it('jest failure xml', async () => {
22+
test('jest failure xml', async (t) => {
2423
const xml = fs.readFileSync(fixturePath('jest-failure.xml'))
2524
const parsed = await junit2json.parse(xml)
2625

27-
assert.snapshot(parsed, { description: 'jest failure xml snapshot' });
26+
t.assert.snapshot(parsed);
2827
})
2928

30-
it('nunit failure xml', async () => {
29+
test('nunit failure xml', async (t) => {
3130
const xml = fs.readFileSync(fixturePath('nunit-failure.xml'))
3231
const parsed = await junit2json.parse(xml)
3332

34-
assert.snapshot(parsed, { description: 'nunit failure xml snapshot' });
33+
t.assert.snapshot(parsed);
3534
})
3635

37-
it('Android robolectric success xml', async () => {
36+
test('Android robolectric success xml', async (t) => {
3837
const xml = fs.readFileSync(fixturePath('android-robolectric-success.xml'))
3938
const parsed = await junit2json.parse(xml)
4039

41-
assert.snapshot(parsed, { description: 'Android robolectric success xml snapshot' });
40+
t.assert.snapshot(parsed);
4241
})
4342
})

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"scripts": {
3232
"clean": "rm -rf dist",
3333
"build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && tsconfig-to-dual-package",
34-
"test": "node --test --experimental-strip-types",
35-
"test:watch": "node --test --experimental-strip-types --watch",
34+
"test": "node --test --experimental-strip-types --experimental-test-snapshots",
35+
"test:watch": "node --test --experimental-strip-types --experimental-test-snapshots --watch",
3636
"doc": "deno doc --unstable-byonm --unstable-sloppy-imports --html --name=junit2json src",
3737
"doc:lint": "deno doc --unstable-byonm --unstable-sloppy-imports --lint src",
3838
"integrate_test": "node --test integrate_tests/",

0 commit comments

Comments
 (0)