Skip to content

Commit 9f9b524

Browse files
Simplify testpack with dedicated end-to-end tests
1 parent ad88ee3 commit 9f9b524

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- run: npm run lint
3636
- run: npm run build
3737
- run: npm run test
38-
- run: npx testpack-cli --keep={jest-when,regex-to-strings,ts-jest,typescript} --replace-import={'#\.\.?#$P#','#\.\.?([\/\\].*)#$P/lib$1#'} **/*.spec.ts
38+
- run: npx testpack-cli --keep={ts-jest,typescript} src/e2e.spec.ts
3939

4040
- name: Upload test coverage report to Codecov
4141
uses: codecov/codecov-action@v1

src/e2e.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { condense, condenseIgnoreCase } from '.';
2+
3+
describe('condense end-to-end', () => {
4+
it('builds a case-sensitive RegEx to match strings', () => {
5+
const stringsToMatch = ['foo', 'foobar', 'Foo', 'fooBarBaz'];
6+
const matcher = condense(stringsToMatch);
7+
8+
expect(matcher).toHaveProperty('flags', '');
9+
expect(matcher).toHaveProperty('source', '(foo(|bar|BarBaz)|Foo)');
10+
});
11+
});
12+
13+
describe('condenseIgnoreCase end-to-end', () => {
14+
it('builds a case-insensitive RegEx to match strings', () => {
15+
const stringsToMatch = ['foo', 'foobar', 'Foo', 'fooBarBaz'];
16+
const matcher = condenseIgnoreCase(stringsToMatch);
17+
18+
expect(matcher).toHaveProperty('flags', 'i');
19+
expect(matcher).toHaveProperty('source', 'foo(|bar(|baz))');
20+
});
21+
});

0 commit comments

Comments
 (0)