Skip to content

Commit

Permalink
chore: add test for report adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
sipayRT committed Mar 28, 2024
1 parent 4fc421b commit b1ac9f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Node.js CI

on:
push:
branches: [ master ]
branches: [ master, sp.addTest ]
pull_request:
branches: [ master ]

Expand Down
15 changes: 15 additions & 0 deletions test/unit/lib/test-adapter/reporter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {ReporterTestAdapter} from 'lib/test-adapter/reporter';
import {ReporterTestResult} from 'lib/test-adapter';

describe('reporterTestAdapter', () => {
const mkReportResult_ = (result: Partial<ReporterTestResult>): ReporterTestResult => {
return Object.assign({}, result) as ReporterTestResult;
};

it('should return correct state', () => {
const reportResult = mkReportResult_({testPath: ['path1', 'path2']});
const testAdapter = new ReporterTestAdapter(reportResult);

assert.deepEqual(testAdapter.state, {name: 'path2'});
});
});

0 comments on commit b1ac9f2

Please sign in to comment.