Skip to content

Commit

Permalink
docs(readme): add @davguij's information on typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMason committed Jul 27, 2017
1 parent daeb708 commit 6eafba8
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,42 @@ Use the [Jasmine CLI](https://www.npmjs.com/package/jasmine) and include the pat
}
```

### TypeScript and Angular CLI Projects

If you are using TypeScript, you might want to
`npm install @types/jasmine-expect --save-dev` in order to prevent your IDE from
complaining about the new Matchers.

Also, if you run into TypeScript compilation errors when running your tests,
add `"jasmine-expect"` to the `"types"` array in your tests' `tsconfig` file.

As an example, for an Angular CLI based project, this would be your
`tsconfig.spec.json` file:

```json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"node",
"jasmine-expect"
]
},
"files": [
"test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
```

### Sublime Text

[Jasmine-Matchers-Snippets](https://github.com/JamieMason/Jasmine-Matchers-Snippets) or [Jasmine-Matchers-ES6-Snippets](https://github.com/JamieMason/Jasmine-Matchers-ES6-Snippets) can be installed with [Package Control](https://packagecontrol.io/packages/Jasmine%20Matchers%20Snippets) to ease development with Jasmine Matchers in Sublime Text.
Expand All @@ -276,3 +312,4 @@ Opera | 11 - 12
Safari | 6 - 9*

\* Safari 5.1 and iOS 5.1 are actually fully supported except for `toBeIso8601`.

36 changes: 36 additions & 0 deletions scripts/readme/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,42 @@ Use the [Jasmine CLI](https://www.npmjs.com/package/jasmine) and include the pat
}
```

### TypeScript and Angular CLI Projects

If you are using TypeScript, you might want to
`npm install @types/jasmine-expect --save-dev` in order to prevent your IDE from
complaining about the new Matchers.

Also, if you run into TypeScript compilation errors when running your tests,
add `"jasmine-expect"` to the `"types"` array in your tests' `tsconfig` file.

As an example, for an Angular CLI based project, this would be your
`tsconfig.spec.json` file:

```json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"node",
"jasmine-expect"
]
},
"files": [
"test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
```

### Sublime Text

[Jasmine-Matchers-Snippets](https://github.com/JamieMason/Jasmine-Matchers-Snippets) or [Jasmine-Matchers-ES6-Snippets](https://github.com/JamieMason/Jasmine-Matchers-ES6-Snippets) can be installed with [Package Control](https://packagecontrol.io/packages/Jasmine%20Matchers%20Snippets) to ease development with Jasmine Matchers in Sublime Text.
Expand Down

0 comments on commit 6eafba8

Please sign in to comment.