Minimal Inline Snapshot utility for uvu/assert http://github.com/lukeed/uvu
MIT License
Minimal Inline Snapshot utility for uvu/assert
npm i uvu uvu-inline-snapshot
const { test } = require('uvu')
const { inlineSnapshot } = require('uvu-inline-snapshot')
const add = (x, y) => x + y
test('example 1', async () => {
await inlineSnapshot(add(1, 2), '')
})
test.run()
// --------------------
// will be converted to
const { test } = require('uvu')
const { inlineSnapshot } = require('uvu-inline-snapshot')
const add = (x, y) => x + y
test('example 1', async () => {
await inlineSnapshot(add(1, 2), '3') // Filled for you
})
test.run()
To update multiple snapshots, just run the tests with UVU_SNAPSHOTS=1
; UVU_SNAPSHOTS=1 uvu