-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Snapshot issues in next-dev-tests (#3774)
This: * Adds issue snapshot support to next-dev-tests. This will allow us to assert that certain issues are raised in tests that require next-dev. * Extracts common snapshot code into a new crates, `turbopack-test-utils`, which is shared between snapshot tests and next-dev-tests. * Implements an issue reporter that emits issues in a channel to the the integration test code, where they are snapshotted. * Fixes an issue where next-dev tests that were not Next.js apps would emit non-fatal issues for a missing `pages/` directory. Co-authored-by: Justin Ridgewell <justin@ridgewell.name> --------- Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
- Loading branch information
1 parent
b7c3082
commit e4a4aa3
Showing
41 changed files
with
730 additions
and
262 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
25 changes: 25 additions & 0 deletions
25
...es/lint TP1004 fs.existsSync(__q____q____q____star__0__star__) is very dynamic-c19e79.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
PlainIssue { | ||
severity: Warning, | ||
context: "[project-with-next]/node_modules/.pnpm/postcss@8.4.20/node_modules/postcss/lib/previous-map.js", | ||
category: "parse", | ||
title: "lint TP1004 fs.existsSync(???*0*) is very dynamic", | ||
description: "- *0* arguments[0]\n ⚠\u{fe0f} function calls are not analysed yet", | ||
detail: "", | ||
documentation_link: "", | ||
source: Some( | ||
PlainIssueSource { | ||
asset: PlainAsset { | ||
path: "node_modules/.pnpm/postcss@8.4.20/node_modules/postcss/lib/previous-map.js", | ||
}, | ||
start: SourcePos { | ||
line: 87, | ||
column: 8, | ||
}, | ||
end: SourcePos { | ||
line: 87, | ||
column: 8, | ||
}, | ||
}, | ||
), | ||
sub_issues: [], | ||
} |
25 changes: 25 additions & 0 deletions
25
...ileSync(__q____q____q____star__0__star__, __quo__utf-8__quo__) is very dynamic-58d7af.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
PlainIssue { | ||
severity: Warning, | ||
context: "[project-with-next]/node_modules/.pnpm/postcss@8.4.20/node_modules/postcss/lib/previous-map.js", | ||
category: "parse", | ||
title: "lint TP1004 fs.readFileSync(???*0*, \"utf-8\") is very dynamic", | ||
description: "- *0* arguments[0]\n ⚠\u{fe0f} function calls are not analysed yet", | ||
detail: "", | ||
documentation_link: "", | ||
source: Some( | ||
PlainIssueSource { | ||
asset: PlainAsset { | ||
path: "node_modules/.pnpm/postcss@8.4.20/node_modules/postcss/lib/previous-map.js", | ||
}, | ||
start: SourcePos { | ||
line: 89, | ||
column: 13, | ||
}, | ||
end: SourcePos { | ||
line: 89, | ||
column: 13, | ||
}, | ||
}, | ||
), | ||
sub_issues: [], | ||
} |
25 changes: 25 additions & 0 deletions
25
...ues/lint TP1006 path.resolve(__q____q____q____star__0__star__) is very dynamic-667243.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
PlainIssue { | ||
severity: Warning, | ||
context: "[project-with-next]/node_modules/.pnpm/postcss@8.4.20/node_modules/postcss/lib/input.js", | ||
category: "parse", | ||
title: "lint TP1006 path.resolve(???*0*) is very dynamic", | ||
description: "- *0* ???*1*[\"from\"]\n ⚠\u{fe0f} unknown object\n- *1* opts\n ⚠\u{fe0f} pattern without value", | ||
detail: "", | ||
documentation_link: "", | ||
source: Some( | ||
PlainIssueSource { | ||
asset: PlainAsset { | ||
path: "node_modules/.pnpm/postcss@8.4.20/node_modules/postcss/lib/input.js", | ||
}, | ||
start: SourcePos { | ||
line: 43, | ||
column: 20, | ||
}, | ||
end: SourcePos { | ||
line: 43, | ||
column: 20, | ||
}, | ||
}, | ||
), | ||
sub_issues: [], | ||
} |
5 changes: 0 additions & 5 deletions
5
crates/next-dev-tests/tests/integration/next/webpack-loaders/basic-options/input/index.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
.../next-dev-tests/tests/integration/next/webpack-loaders/basic-options/input/pages/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useEffect } from "react"; | ||
import source from "./hello.replace"; | ||
|
||
export default function Home() { | ||
useEffect(() => { | ||
// Only run on client | ||
import("@turbo/pack-test-harness").then(runTests); | ||
}); | ||
|
||
return null; | ||
} | ||
|
||
function runTests() { | ||
it("runs a loader with basic options", () => { | ||
expect(source).toBe(3); | ||
}); | ||
} |
5 changes: 0 additions & 5 deletions
5
crates/next-dev-tests/tests/integration/next/webpack-loaders/no-options/input/index.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.