Skip to content

Commit

Permalink
feat: remove tap from test plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
hongaar committed Sep 27, 2023
1 parent 4b3146a commit 967b466
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1,597 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,7 @@ this by setting the `private` property in `package.json` to `false`.
_Scope: repo or workspace_
This plugin enables testing with the native
[node --test](https://nodejs.org/api/test.html) functionality. It uses
[tap](https://node-tap.org) for formatting the TAP output.
[node --test](https://nodejs.org/api/test.html) functionality.
When the `typescript` plugin is also installed, it will use
[ts-node](https://typestrong.org/ts-node/) to load TypeScript test files.
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"clean": "rm -rf dist && rm -rf types",
"prepublish": "yarn build && cp ../../README.md .",
"start": "node moker.js",
"test": "NODE_OPTIONS='--loader=ts-node/esm --no-warnings' node --test test/*.test.ts | NODE_OPTIONS='--loader=ts-node/esm --no-warnings' tap --no-coverage"
"test": "NODE_OPTIONS='--loader=ts-node/esm --no-warnings' node --test test/*.test.ts"
},
"dependencies": {
"@mokr/core": "workspace:*",
Expand All @@ -29,7 +29,6 @@
},
"devDependencies": {
"@types/node": "20.7.0",
"tap": "16.3.8",
"ts-node": "10.9.1",
"typescript": "5.2.2"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:watch": "tsc --watch",
"clean": "rm -rf dist && rm -rf types",
"prepublish": "yarn build",
"test": "NODE_OPTIONS='--loader=ts-node/esm --no-warnings' node --test test/*.test.ts | NODE_OPTIONS='--loader=ts-node/esm --no-warnings' tap --no-coverage"
"test": "NODE_OPTIONS='--loader=ts-node/esm --no-warnings' node --test test/*.test.ts"
},
"dependencies": {
"chalk": "5.3.0",
Expand All @@ -32,7 +32,6 @@
"devDependencies": {
"@types/hosted-git-info": "3.0.3",
"@types/node": "20.7.0",
"tap": "16.3.8",
"tempy": "3.1.0",
"ts-node": "10.9.1",
"typescript": "5.2.2"
Expand Down
12 changes: 3 additions & 9 deletions packages/plugins/src/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@ import {
async function install({ directory }: PluginArgs) {
const monorepoDirectory = await getMonorepoDirectory({ directory });

enqueueInstallDependency({
directory,
identifier: ["tap"],
dev: true,
});

if (!hasPlugin({ directory, name: "typescript" })) {
await writePackage({
directory,
data: {
scripts: {
test: "node --test | tap",
test: "node --test",
},
},
});
Expand All @@ -38,7 +32,7 @@ async function install({ directory }: PluginArgs) {
directory,
data: {
scripts: {
test: "NODE_OPTIONS='--loader=ts-node/esm --no-warnings' node --test test/*.test.ts | tap",
test: "NODE_OPTIONS='--loader=ts-node/esm --no-warnings' node --test test/*.test.ts",
},
},
});
Expand All @@ -57,7 +51,7 @@ async function install({ directory }: PluginArgs) {
}

async function remove({ directory }: PluginArgs) {
enqueueRemoveDependency({ directory, identifier: ["tap", "ts-node"] });
enqueueRemoveDependency({ directory, identifier: ["ts-node"] });

warning("Please review package.json manually");
}
Expand Down
Loading

0 comments on commit 967b466

Please sign in to comment.