Skip to content

Commit 7ee14c6

Browse files
authored
Merge pull request #81 from bcaudan/typescript
Migrate codebase to typescript
2 parents 36e6157 + 7765bb8 commit 7ee14c6

File tree

90 files changed

+2466
-1865
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2466
-1865
lines changed

.gitignore

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
1-
# Logs
2-
logs
3-
*.log
4-
5-
# Runtime data
6-
pids
7-
*.pid
8-
*.seed
9-
10-
# Directory for instrumented libs generated by jscoverage/JSCover
11-
lib-cov
12-
13-
# Coverage directory used by tools like istanbul
141
coverage
15-
16-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17-
.grunt
18-
19-
# Compiled binary addons (http://nodejs.org/api/addons.html)
20-
build/Release
21-
22-
# Dependency directory
23-
# Deployed apps should consider commenting this line out:
24-
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
252
node_modules
3+
built
4+
spec/**/*.js
5+
src/**/*.js
6+
*.log

.npmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.idea
2+
coverage
3+
docs
4+
node_modules
5+
spec
6+
!examples/node/spec
7+
!examples/protractor/spec
8+
!examples/typescript/spec
9+
src
10+
typings
11+
!examples/typescript/typings
12+
13+
.gitignore
14+
.istanbul.yml
15+
.travis.yml
16+
jasmine-spec-reporter.iml
17+
npm-debug.log
18+
screenshot.png
19+
tsconfig.json
20+
tslint.json
21+
typings.json
22+
23+
*~

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- '4.1'
4-
- '0.10'
3+
- '6.5'
4+
- '4.5'
55
script:
66
- npm run coveralls

README.md

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,58 +15,22 @@ Install `jasmine-spec-reporter` via npm:
1515

1616
npm install jasmine-spec-reporter --save-dev
1717

18+
## Examples
19+
* [Jasmine node tests](examples/node)
20+
* [Protractor tests](examples/protractor)
21+
* [TypeScript support](examples/typescript)
22+
1823
## Configuration
19-
* [Jasmine node tests](docs/jasmine-npm-configuration.md)
20-
* [Protractor tests](docs/protractor-configuration.md)
24+
See full configuration and features: [configuration.ts](src/configuration.ts)
2125

2226
## Custom output
2327
You can customize the output of the reporter yourself: [see how](docs/customize-output.md).
2428

25-
# Default options
26-
27-
```js
28-
{
29-
displayStacktrace: 'none', // display stacktrace for each failed assertion, values: (all|specs|summary|none)
30-
displaySuccessesSummary: false, // display summary of all successes after execution
31-
displayFailuresSummary: true, // display summary of all failures after execution
32-
displayPendingSummary: true, // display summary of all pending specs after execution
33-
displaySuccessfulSpec: true, // display each successful spec
34-
displayFailedSpec: true, // display each failed spec
35-
displayPendingSpec: false, // display each pending spec
36-
displaySpecDuration: false, // display each spec duration
37-
displaySuiteNumber: false, // display each suite number (hierarchical)
38-
colors: {
39-
success: 'green',
40-
failure: 'red',
41-
pending: 'yellow'
42-
},
43-
prefixes: {
44-
success: '',
45-
failure: '',
46-
pending: '* '
47-
},
48-
customProcessors: []
49-
}
50-
```
51-
52-
Colors are displayed in the console via [colors](https://github.com/Marak/colors.js), you can see all available colors on the [project page](https://github.com/Marak/colors.js).
53-
You can also disable colors with the option: `colors: false`.
54-
55-
# Compatibility with Jasmine 1.x
56-
57-
To use Jasmine spec reporter with Jasmine 1.x, please see [jasmine1 branch](https://github.com/bcaudan/jasmine-spec-reporter/tree/jasmine1).
58-
5929
# Developement
6030

6131
* install dependencies: `npm install`
62-
* launch all unit tests: `npm test`
63-
* launch an output example: `npm run example`
64-
* launch a protractor example:
65-
```sh
66-
npm run webdriver-update # if needed
67-
npm run webdriver-start
68-
npm run protractor-example
69-
```
32+
* compile sources: `npm run tsc`
33+
* launch unit tests: `npm test`
7034

7135
# Contribution
7236

docs/customize-output.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Let's say that you want to add the current time before each output of the report
2121
You need to require the display processor:
2222

2323
```node
24-
var DisplayProcessor = require('./node_modules/jasmine-spec-reporter/src/display-processor');
24+
var DisplayProcessor = require('jasmine-spec-reporter').DisplayProcessor;
2525
```
2626

2727
You can then customize the following methods:
@@ -37,9 +37,9 @@ The first argument is the jasmine object corresponding to the suite or the spec.
3737
For our example:
3838

3939
```node
40-
var DisplayProcessor = require('./node_modules/jasmine-spec-reporter/src/display-processor');
40+
var DisplayProcessor = require('jasmine-spec-reporter').DisplayProcessor;
4141

42-
function TimeProcessor(options) {
42+
function TimeProcessor(configuration) {
4343
}
4444

4545
function getTime() {
@@ -73,7 +73,7 @@ TimeProcessor.prototype.displayPendingSpec = function (spec, log) {
7373
Then you need to configure jasmine spec reporter to use your processor:
7474

7575
```node
76-
var SpecReporter = require('jasmine-spec-reporter');
76+
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
7777

7878
var reporter = new SpecReporter({
7979
customProcessors: [TimeProcessor]

docs/jasmine-npm-configuration.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

example/example-spec.coffee

Lines changed: 0 additions & 42 deletions
This file was deleted.

example/run-example.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

examples/node/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Use jasmine-spec-reporter with Node
2+
===================================
3+
The `jasmine-spec-reporter` can be used to enhance your [jasmine node](https://github.com/jasmine/jasmine-npm) tests execution report.
4+
5+
## Configuration
6+
7+
Create a `jasmine-runner.js` file with the following content:
8+
9+
```node
10+
let Jasmine = require('jasmine');
11+
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
12+
13+
let jrunner = new Jasmine();
14+
jrunner.env.clearReporters(); // remove default reporter logs
15+
jrunner.addReporter(new SpecReporter({ // add jasmine-spec-reporter
16+
spec: {
17+
displayPending: true
18+
}
19+
}));
20+
jrunner.loadConfigFile(); // load jasmine.json configuration
21+
jrunner.execute();
22+
```
23+
24+
Then run your tests with:
25+
26+
node jasmine-runner.js
27+
28+
## Example
29+
30+
You can find an example in this directory:
31+
32+
npm install
33+
npm start

examples/node/jasmine-runner.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
let Jasmine = require('jasmine');
2+
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
3+
4+
let jrunner = new Jasmine();
5+
jrunner.env.clearReporters(); // remove default reporter logs
6+
jrunner.addReporter(new SpecReporter({ // add jasmine-spec-reporter
7+
spec: {
8+
displayPending: true
9+
}
10+
}));
11+
jrunner.loadConfigFile(); // load jasmine.json configuration
12+
jrunner.execute();

0 commit comments

Comments
 (0)