mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-01 08:59:39 +02:00
ci: configure Codecov coverage uploads (#150)
This commit is contained in:
parent
75bb4f9497
commit
366c44f224
6 changed files with 222 additions and 9 deletions
31
scripts/normalize-lcov-paths.test.mjs
Normal file
31
scripts/normalize-lcov-paths.test.mjs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import assert from 'node:assert/strict';
|
||||
import { describe, it } from 'node:test';
|
||||
|
||||
import { normalizeLcovContent } from './normalize-lcov-paths.mjs';
|
||||
|
||||
describe('normalizeLcovContent', () => {
|
||||
it('prefixes relative LCOV source paths with the package path', () => {
|
||||
const input = ['TN:', 'SF:src/index.ts', 'SF:src\\windows.ts', 'DA:1,1', 'end_of_record'].join('\n');
|
||||
|
||||
assert.equal(
|
||||
normalizeLcovContent(input, 'packages/context'),
|
||||
[
|
||||
'TN:',
|
||||
'SF:packages/context/src/index.ts',
|
||||
'SF:packages/context/src/windows.ts',
|
||||
'DA:1,1',
|
||||
'end_of_record',
|
||||
].join('\n'),
|
||||
);
|
||||
});
|
||||
|
||||
it('leaves already-normalized and absolute paths unchanged', () => {
|
||||
const input = [
|
||||
'SF:packages/cli/src/index.ts',
|
||||
'SF:/tmp/repo/packages/cli/src/index.ts',
|
||||
'SF:../shared/source.ts',
|
||||
].join('\n');
|
||||
|
||||
assert.equal(normalizeLcovContent(input, 'packages/cli'), input);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue