Skip to content

Commit

Permalink
Move integration test entries to input/ (vercel#3590)
Browse files Browse the repository at this point in the history
Moves all next-dev integration test code into a parent `input/`
directory, like our snapshot tests. This prepares for introducing
`issues` snapshots to next-dev integration tests.

Test Plan: CI
  • Loading branch information
wbinnssmith authored Feb 3, 2023
1 parent 99061a8 commit 5b7c53f
Show file tree
Hide file tree
Showing 174 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions crates/next-dev-tests/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,9 @@ async fn run_test(resource: &str) -> JestRunResult {
path.to_str().unwrap()
);

// Count the number of dirs _under_ crates/next-dev/tests
let test_entry = Path::new(resource).join("index.js");
let package_root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let workspace_root = package_root.parent().unwrap().parent().unwrap();
let project_dir = workspace_root.join(resource);
let project_dir = workspace_root.join(resource).join("input");
let requested_addr = get_free_local_addr().unwrap();

let mock_dir = path.join("__httpmock__");
Expand All @@ -151,9 +149,7 @@ async fn run_test(resource: &str) -> JestRunResult {
"@turbo/pack-test-harness".to_string(),
"".to_string(),
))
.entry_request(EntryRequest::Relative(
sys_to_unix(test_entry.strip_prefix(resource).unwrap().to_str().unwrap()).to_string(),
))
.entry_request(EntryRequest::Relative("index.js".to_owned()))
.eager_compile(false)
.hostname(requested_addr.ip())
.port(requested_addr.port())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function Home() {
function runTests() {
it("returns structured data about the font styles from the font function", () => {
expect(interNoArgs).toEqual({
className: "className__inter_34ab8b4d__77c0d301",
className: "className__inter_34ab8b4d__64ed1f97",
style: {
fontFamily: "'__Inter_34ab8b4d'",
fontStyle: "normal",
Expand All @@ -35,12 +35,12 @@ function runTests() {

it("supports declaring a css custom property (css variable)", async () => {
expect(interWithVariableName).toEqual({
className: "className__inter_c6e282f1__d812ce46",
className: "className__inter_c6e282f1__a8cc5613",
style: {
fontFamily: "'__Inter_c6e282f1'",
fontStyle: "normal",
},
variable: "variable__inter_c6e282f1__d812ce46",
variable: "variable__inter_c6e282f1__a8cc5613",
});

const matchingRule = await getRuleMatchingClassName(
Expand Down

0 comments on commit 5b7c53f

Please sign in to comment.