fix(pnpm/test): add escape characters (#5193)

* fix(pnpm/test): add escape characters

* test: refactor

close #5192

Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
那里好脏不可以
2022-08-13 21:06:29 +08:00
committed by GitHub
parent 5e7418db12
commit bb2a69c8d0
2 changed files with 3 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ test('some commands pass through to npm', () => {
const result = execPnpmSync(['dist-tag', 'ls', 'is-positive'])
expect(result.status).toBe(0)
expect(result.stdout.toString()).not.toMatch(/Usage: pnpm [command] [flags]/)
expect(result.stdout.toString()).not.toContain('Usage: pnpm [command] [flags]')
})
test('installs in the folder where the package.json file is', async () => {

View File

@@ -118,8 +118,8 @@ test('fail on invalid JSON', async () => {
expect(err).toBeTruthy()
expect(err['code']).toBe('ERR_PNPM_JSON_PARSE')
// eslint-disable-next-line
expect(err.message).toMatch(/^Unexpected string in JSON at position 20 while parsing \'{ "name": "foo" "version": "1.0.0"}\' in /)
expect(err.message).toContain('Unexpected string in JSON at position 20 while parsing \'{ "name": "foo" "version": "1.0.0"}\' in ')
})
test('fail on invalid JSON5', async () => {