Skip to content

Commit 6f16588

Browse files
committed
test: adds a simple test with babel 7
1 parent c43c135 commit 6f16588

13 files changed

Lines changed: 5405 additions & 12 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export class Hello {
2+
constructor(readonly msg: string) {}
3+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
declare var jest, describe, it, expect;
2+
3+
import { Hello } from '../Hello';
4+
5+
describe('Hello Class', () => {
6+
it('should create a new Hello', () => {
7+
const hello = new Hello('foo');
8+
expect(hello.msg).toBe('foo');
9+
});
10+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"e2eTemplate": "with-babel-7",
3+
4+
"jest": {
5+
"transform": {
6+
"^.+\\.tsx?$": "ts-jest"
7+
},
8+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
9+
"moduleFileExtensions": ["ts", "js"],
10+
"testEnvironment": "node"
11+
}
12+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
}
5+
}

e2e/__templates__/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ Let's say you want to create a template with the `lodash` package and call the t
1414
2. `mkdir with-lodash`
1515
3. `cp default/*.json with-lodash/`
1616
4. `cd with-lodash`
17-
5. `npm install && npm install --save lodash`
18-
6. `rm -rf node_modules` this is not mandatory but it'll make the test run faster, `npm ci` is faster than copying over tons of files
17+
5. edit `package.json` to give it another `name`
18+
6. `npm install && npm install --save lodash` (or `--save-dev`, but **use npm and NOT yarn**)
19+
7. `rm -rf node_modules` this is not mandatory but it'll make the test run faster, `npm ci` is faster than copying over tons of files
1920

2021
That's it, the template is ready to be used
2122

e2e/__templates__/default/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/__templates__/default/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "ts-jest-e2e-tmpl",
2+
"name": "ts-jest-e2e-tmpl-default",
33
"version": "0.0.0-test.0",
44
"private": true,
55
"devDependencies": {

0 commit comments

Comments
 (0)