mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-24 01:51:41 -04:00
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:
@@ -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 () => {
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user