Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
feat: add test command (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahabhgk authored Mar 7, 2024
1 parent 2519446 commit f452da4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"scripts": {
"build": "pnpm --filter './packages/**' build",
"test": "pnpm --filter './packages/**' test",
"check": "node ./scripts/check.js"
},
"packageManager": "pnpm@8.9.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/rspack-manifest-plugin@5/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@rspack-compat/rspack-manifest-plugin_4",
"scripts": {
"build": "rspack build"
"build": "rspack build",
"test": "node ./test.js"
},
"devDependencies": {
"@rspack/cli": "0.3.11",
Expand Down
12 changes: 12 additions & 0 deletions packages/rspack-manifest-plugin@5/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { test } = require('node:test');
const assert = require("node:assert");
const fs = require("node:fs")
const path = require("node:path")

test("should have manifest", async (t) => {
const manifest = path.resolve(__dirname, 'dist', 'rspack-manifest.json');
assert(fs.existsSync(manifest))
const manifestJson = JSON.parse(await fs.promises.readFile(manifest, 'utf-8'))
assert(manifestJson.files['main.js'] === "auto/main.js")
assert(manifestJson.entrypoints.includes("main.js"))
})

0 comments on commit f452da4

Please sign in to comment.