Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasLYang committed Jul 19, 2024
1 parent b834a45 commit 84767f9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions turborepo-tests/integration/tests/invalid-package-json.t
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,25 @@ Add invalid packageManager field that passes the regex.
7 | "workspaces": [
`----

Restore packageManager field
$ jq '.packageManager = "[email protected]"' package.json > package.json.new
$ mv package.json.new package.json

Add a trailing comma
$ echo "{ \"name\": \"foobar\", }" > package.json.new
$ mv package.json.new apps/my-app/package.json
Build should fail due to trailing comma (sed replaces square brackets with parentheses)
$ ${TURBO} build 2>&1 | sed 's/\[\([^]]*\)\]/\(\1)/g'
package_json_parse_error
x unable to parse package.json
Error: x Expected a property but instead found '}'.
,-\(.*package.json:1:1\) (re)
1 | { "name": "foobar", }
: ^
`----

0 comments on commit 84767f9

Please sign in to comment.