Skip to content

Commit

Permalink
test: update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Aug 26, 2024
1 parent a861b97 commit 5aa30da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,15 @@ test('prefixing handles line segments', t => {
program = `node -e "${program}"`
program = program.replace(/"/g, '\\"')

const stdout = execSync(`./bin/index.js "${program}" --names "foo"`, {
let stdout = execSync(`./bin/index.js "${program}" --names "foo"`, {
encoding: 'utf-8',
stdio: 'pipe'
})

// strip pid from stdout
stdout = stdout.replace(/pid=\d+/gm, 'pid=0')
// strip ansi from stdout
stdout = stdout.replace(/\u001b\[\d+m/g, '') // eslint-disable-line

t.snapshot(stdout)
})
8 changes: 4 additions & 4 deletions test/snapshots/index.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Generated by [AVA](https://avajs.dev).

> Snapshot 1
`[33mfoo[39m [90mstarted pid=79072[39m
[33mfoo[39m hello [33mfoo[39m world␊
[33mfoo[39m nice to meet you[33mfoo[39m [90mcmd='node -e "␊
`foo started pid=0
foo hello foo world␊
foo nice to meet youfoo cmd='node -e "␊
process.stdout.write('hello ', () => {␊
process.stdout.write('world\\n', () => {␊
process.stdout.write('nice to meet you')␊
})␊
})␊
"' exitCode=0 signalCode=null duration=0s[39m
"' exitCode=0 signalCode=null duration=0s␊
`
Binary file modified test/snapshots/index.js.snap
Binary file not shown.

0 comments on commit 5aa30da

Please sign in to comment.