Skip to content

Commit

Permalink
Add mdx to node-file-trace test
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jan 13, 2023
1 parent c125463 commit 46d21ec
Show file tree
Hide file tree
Showing 5 changed files with 194 additions and 41 deletions.
1 change: 1 addition & 0 deletions crates/turbopack/tests/node-file-trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ static ALLOC: turbo_malloc::TurboMalloc = turbo_malloc::TurboMalloc;
#[case::mailgun("integration/mailgun.js")]
#[case::mariadb("integration/mariadb.js")]
#[case::memcached("integration/memcached.js")]
#[case::mdx("integration/mdx/index.js")]
#[case::mongoose("integration/mongoose.js")]
#[case::mysql("integration/mysql.js")]
#[case::npm("integration/npm.js")]
Expand Down
Empty file.
15 changes: 14 additions & 1 deletion crates/turbopack/tests/node-file-trace/integration/mdx/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
import Example from "./example.mdx";
const moduleAlias = require("module-alias");
const os = require("os");

require("./empty");

moduleAlias.addAlias("./example.mdx", __dirname + "/empty.js");

const Example = require("./example.mdx");

const { existsSync } = eval("require")("fs");

if (__dirname.startsWith(os.tmpdir()) && existsSync("./snowfall.jsx")) {
throw new Error("snowfall.jsx should not exist");
}
1 change: 1 addition & 0 deletions crates/turbopack/tests/node-file-trace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"mailgun": "^0.5.0",
"mariadb": "^2.0.5",
"memcached": "^2.2.2",
"module-alias": "^2.2.2",
"mongoose": "^5.7.5",
"mysql": "^2.17.1",
"npm": "^6.14.6",
Expand Down
Loading

0 comments on commit 46d21ec

Please sign in to comment.