Skip to content

Commit 7f5bd4c

Browse files
committed
test: Added tests and wired up CI to run said tests
1 parent b5e2330 commit 7f5bd4c

File tree

28 files changed

+486
-12
lines changed

28 files changed

+486
-12
lines changed

.c8rc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"reporter": ["lcov"],
3+
"exclude": ["test/*"],
4+
"clean": true
5+
}

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
jobs:
7+
test:
8+
name: Run Tests
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [20, 22, 24]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: ${{ matrix.node-version }}
18+
- name: Install Dependencies
19+
run: npm install
20+
- name: Run Tests
21+
run: npm test
22+
23+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
coverage
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"class Foo {\n constructor() {\n this.name = 'foo'\n }\n\n doStuff() {\n return 'doing stuff'\n }\n}\n\nexport default Foo\n\n"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"class Test {\n constructor() {\n this.name = 'Test'\n }\n\n getName() {\n return this.name\n }\n}\n\nmodule.exports = Test\n"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"const { tracingChannel: tr_ch_apm_tracingChannel } = require(\"diagnostics_channel\");\nconst tr_ch_apm$unitTestCjs = tr_ch_apm_tracingChannel(\"orchestrion:pkg-1:unitTestCjs\");\nclass Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTestCjs.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTestCjs.tracePromise(__apm$traced, {\n arguments,\n self: this\n });\n }\n}\nmodule.exports = Foo;\n"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"const { tracingChannel: tr_ch_apm_tracingChannel } = require(\"diagnostics_channel\");\nconst tr_ch_apm$unitTestCjs = tr_ch_apm_tracingChannel(\"orchestrion:pkg-1:unitTestCjs\");\nclass Foo {\n constructor(){\n this.name = 'foo';\n }\n doStuff() {\n const __apm$original_args = arguments;\n const __apm$traced = async ()=>{\n const __apm$wrapped = async ()=>{\n return 'doing stuff';\n };\n return __apm$wrapped.apply(null, __apm$original_args);\n };\n if (!tr_ch_apm$unitTestCjs.hasSubscribers) return __apm$traced();\n return tr_ch_apm$unitTestCjs.tracePromise(__apm$traced, {\n arguments,\n self: this\n });\n }\n}\nmodule.exports = Foo;\n"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"class Foo {\n constructor() {\n this.name = 'foo'\n }\n\n doStuff() {\n return 'doing stuff'\n }\n}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"class Test {\n constructor() {\n this.name = 'Test'\n }\n\n getName() {\n return this.name\n }\n}\n\nexport default Test\n\n"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"class Test {\n constructor() {\n this.name = 'Test'\n }\n\n getName() {\n return this.name\n }\n}"

0 commit comments

Comments
 (0)