Skip to content

Commit

Permalink
feat(core/internal): migrate to Japa as test runner.
Browse files Browse the repository at this point in the history
tap is a bit of a mess right now and its time to cut losses
  • Loading branch information
paambaati committed May 30, 2024
1 parent 9903f40 commit c909795
Show file tree
Hide file tree
Showing 16 changed files with 2,812 additions and 3,415 deletions.
8 changes: 8 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"src": "./src",
"all": true,
"reporter": [
"text",
"lcovonly"
]
}
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:

- name: setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: setup node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -66,8 +64,6 @@ jobs:

- name: setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: setup node.js
uses: actions/setup-node@v4
Expand All @@ -92,8 +88,6 @@ jobs:

- name: setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: setup node.js
uses: actions/setup-node@v4
Expand All @@ -114,4 +108,4 @@ jobs:
with:
debug: true
coverageLocations: |
${{github.workspace}}/.tap/report/lcov.info:lcov
${{github.workspace}}/coverage/lcov.info:lcov
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ node_modules/
coverage/
test.sh
test.sh.sha256
.tap/
.tsimp/
**/*.js

19 changes: 19 additions & 0 deletions bin/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { assert } from '@japa/assert';
import { configure, processCLIArgs, run } from '@japa/runner';

processCLIArgs(process.argv.splice(2));
configure({
suites: [
{
name: 'unit',
files: ['test/unit/**/*.test.ts'],
},
{
name: 'integration',
files: ['test/integration/**/*.test.ts'],
},
],
plugins: [assert()],
});

await run();
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.1/schema.json",
"files": {
"include": ["./src/**/*.ts", "./test/**/*.ts"],
"include": ["./src/**/*.ts", "bin/test.ts", "./test/**/*.ts"],
"ignore": ["./test/fixtures/**/*"]
},
"organizeImports": {
Expand Down
128 changes: 60 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,70 +1,62 @@
{
"name": "codeclimate-action",
"version": "6.0.0",
"private": true,
"description": "Publish code coverage to Code Climate",
"type": "module",
"main": "lib/main.js",
"packageManager": "pnpm@9.1.3",
"scripts": {
"build": "tsc",
"test": "cross-env NODE_OPTIONS=\"--no-warnings\" tap run --disable-coverage",
"test:only": "pnpm run test --only",
"coverage": "pnpm run test --no-disable-coverage --allow-incomplete-coverage --coverage-report=lcovonly",
"coverage:html": "pnpm run coverage --coverage-report=html",
"biome:ci": "biome ci ./",
"format:check": "biome format ./",
"format": "biome format --write ./",
"lint:check": "biome lint ./",
"lint": "biome lint --apply ./",
"lint:unsafe": "biome lint --apply-unsafe ./"
},
"repository": {
"type": "git",
"url": "https://github.com/paambaati/codeclimate-action.git"
},
"keywords": [
"actions",
"codeclimate",
"quality",
"coverage"
],
"author": "GP <me@httgp.com>",
"license": "MIT",
"dependencies": {
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1",
"@actions/github": "6.0.0",
"@actions/glob": "0.4.0",
"hook-std": "3.0.0",
"node-fetch": "3.3.2",
"openpgp": "5.11.1"
},
"devDependencies": {
"@biomejs/biome": "1.7.3",
"@openpgp/web-stream-tools": "0.1.1",
"@tapjs/core": "2.0.1",
"@tapjs/test": "2.0.1",
"@tapjs/tsx": "1.1.25",
"@tsconfig/node20": "20.1.4",
"@tsconfig/strictest": "2.0.5",
"@types/node": "20.12.12",
"@types/node-fetch": "2.6.11",
"@types/sinon": "17.0.3",
"@types/which": "3.0.3",
"cross-env": "7.0.3",
"nock": "13.5.4",
"sinon": "18.0.0",
"tap": "19.0.2",
"to-readable-stream": "4.0.0",
"ts-node": "10.9.2",
"typescript": "5.4.5",
"which": "4.0.0"
},
"tap": {
"plugin": [
"!@tapjs/typescript",
"@tapjs/tsx"
]
}
"name": "codeclimate-action",
"version": "6.0.0",
"private": true,
"description": "Publish code coverage to Code Climate",
"type": "module",
"main": "lib/main.js",
"packageManager": "pnpm@9.1.3",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"test": "node --import=tsimp/import --enable-source-maps bin/test.ts",
"coverage": "c8 pnpm run test",
"coverage:html": "c8 --reporter=html pnpm run test",
"biome:ci": "biome ci ./",
"format:check": "biome format ./",
"format": "biome format --write ./",
"lint:check": "biome lint ./",
"lint": "biome lint --apply ./",
"lint:unsafe": "biome lint --apply-unsafe ./"
},
"repository": {
"type": "git",
"url": "https://github.com/paambaati/codeclimate-action.git"
},
"keywords": [
"actions",
"codeclimate",
"quality",
"coverage"
],
"author": "GP <me@httgp.com>",
"license": "MIT",
"dependencies": {
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1",
"@actions/github": "6.0.0",
"@actions/glob": "0.4.0",
"hook-std": "3.0.0",
"node-fetch": "3.3.2",
"openpgp": "5.11.1"
},
"devDependencies": {
"@biomejs/biome": "1.7.3",
"@japa/assert": "3.0.0",
"@japa/runner": "3.1.4",
"@openpgp/web-stream-tools": "0.1.1",
"@tsconfig/node20": "20.1.4",
"@tsconfig/strictest": "2.0.5",
"@types/node": "20.12.13",
"@types/node-fetch": "2.6.11",
"@types/sinon": "17.0.3",
"@types/which": "3.0.3",
"c8": "9.1.0",
"cross-env": "7.0.3",
"into-stream": "8.0.1",
"nock": "13.5.4",
"sinon": "18.0.0",
"tsimp": "2.0.11",
"typescript": "5.4.5",
"which": "4.0.0"
}
}
Loading

0 comments on commit c909795

Please sign in to comment.