Skip to content

Commit a282c38

Browse files
committed
test(core): add basic tests for mocha describe
1 parent a2b8bee commit a282c38

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
exports[`it yo 2 1`] = `Object {
2+
"name": 3,
3+
}`
4+
5+
exports[`it yo 2 2`] = `Object {
6+
"name": 1,
7+
}`
8+
9+
exports[`lols 1`] = `Array [
10+
Object {
11+
"name": 1,
12+
},
13+
Object {
14+
"name": 2,
15+
},
16+
]`
17+
18+
exports[`should yo 1`] = `"make it rain"`

tests/mocha-suite.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { describe, it } = require('node:test')
2+
const { snapshot } = require('../src/snapshot.js')
3+
4+
describe('yo', () => {
5+
it('should yo', ctx => {
6+
snapshot(ctx, 'make it rain')
7+
})
8+
})
9+
10+
describe('yo 2', () => {
11+
it('it yo 2', ctx => {
12+
snapshot(ctx, { name: 3 })
13+
snapshot(ctx, { name: 1 })
14+
})
15+
})
16+
17+
describe('for', () => {
18+
it('lols', ctx => {
19+
snapshot(ctx, [{ name: 1 }, { name: 2 }])
20+
})
21+
})

0 commit comments

Comments
 (0)