Skip to content

Commit

Permalink
fix: stop using snapshot for checking invalid package json
Browse files Browse the repository at this point in the history
  • Loading branch information
khendrikse committed Oct 6, 2023
1 parent 6f84bd6 commit d6139ba
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 53 deletions.
52 changes: 0 additions & 52 deletions packages/build/tests/functions/snapshots/tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,58 +283,6 @@ Generated by [AVA](https://avajs.dev).
(Netlify Build completed in 1ms)␊
Build step duration: Netlify Build completed in 1ms`

## Functions: invalid package.json

> Snapshot 1
`␊
Netlify Build ␊
────────────────────────────────────────────────────────────────␊
> Version␊
@netlify/build 1.0.0␊
> Flags␊
debug: true␊
repositoryRoot: packages/build/tests/functions/fixtures/functions_package_json_invalid␊
testOpts:␊
pluginsListUrl: test␊
silentLingeringProcesses: true␊
> Current directory␊
packages/build/tests/functions/fixtures/functions_package_json_invalid␊
> Config file␊
packages/build/tests/functions/fixtures/functions_package_json_invalid/netlify.toml␊
> Resolved config␊
build:␊
publish: packages/build/tests/functions/fixtures/functions_package_json_invalid␊
publishOrigin: default␊
functionsDirectory: packages/build/tests/functions/fixtures/functions_package_json_invalid/functions␊
> Context␊
production␊
Functions bundling ␊
────────────────────────────────────────────────────────────────␊
Packaging Functions from functions directory:␊
- test.js␊
Configuration error ␊
────────────────────────────────────────────────────────────────␊
Error message␊
Unexpected token { in JSON at position 1␊
Resolved config␊
build:␊
publish: packages/build/tests/functions/fixtures/functions_package_json_invalid␊
publishOrigin: default␊
functionsDirectory: packages/build/tests/functions/fixtures/functions_package_json_invalid/functions`

## Functions: --functionsDistDir

> Snapshot 1
Expand Down
Binary file modified packages/build/tests/functions/snapshots/tests.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/build/tests/functions/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test('Functions: invalid package.json', async (t) => {
await writeFile(packageJsonPath, '{{}')
try {
const output = await new Fixture('./fixtures/functions_package_json_invalid').runWithBuild()
t.snapshot(normalizeOutput(output))
t.true(output.includes('Configuration error'))
} finally {
await rm(packageJsonPath, { force: true, recursive: true, maxRetries: 10 })
}
Expand Down

0 comments on commit d6139ba

Please sign in to comment.