Last active
December 15, 2015 13:49
-
-
Save jonmcewen/5270359 to your computer and use it in GitHub Desktop.
frisby/jasmine-node problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When I run: | |
$ jasmine-node --verbose . | |
I get absolutely no output. | |
Same with: | |
$ jasmine-node --verbose frisby.spec.js | |
However this works: | |
$ jasmine-node --verbose pure-jasmine.spec.js | |
A suite | |
contains spec with an expectation | |
Finished in 0.148 seconds | |
1 test, 1 assertion, 0 failures | |
So there is obviously a problem with the example frisby spec, but I get no indication of what the problem might be. | |
Spec files and package versions: | |
--------------------------------- | |
There are 2 spec files in the directory: | |
pure-jasmine.spec.js: | |
describe("A suite", function() { | |
it("contains spec with an expectation", function() { | |
expect(true).toBe(true); | |
}); | |
}); | |
frisby.spec.js: | |
require('frisby'); | |
var URL = 'http://localhost:3000/'; | |
var URL_AUTH = 'http://username:password@localhost:3000/'; | |
frisby.globalSetup({ // globalSetup is for ALL requests | |
request: { | |
headers: { 'X-Auth-Token': 'fa8426a0-8eaf-4d22-8e13-7c1b16a9370c' } | |
} | |
}); | |
frisby.create('GET user johndoe') | |
.get(URL + '/users/3.json') | |
.expectStatus(200) | |
.expectJSONTypes({ | |
id: Number, | |
username: String, | |
is_admin: Boolean | |
}) | |
.expectJSON({ | |
id: 3, | |
username: 'johndoe', | |
is_admin: false | |
}) | |
// 'afterJSON' automatically parses response body as JSON and passes it as an argument | |
.afterJSON(function(user) { | |
// You can use any normal jasmine-style assertions here | |
expect(1+1).toEqual(2); | |
// Use data from previous result in next test | |
frisby.create('Update user') | |
.put(URL_AUTH + '/users/' + user.id + '.json', {tags: ['jasmine', 'bdd']}) | |
.expectStatus(200) | |
.toss(); | |
}) | |
.toss(); | |
VERSIONS: | |
node v0.10.2 | |
$npm list -g | |
/usr/local/lib | |
├─┬ [email protected] | |
│ ├── [email protected] | |
│ ├─┬ [email protected] | |
│ │ └── [email protected] | |
│ ├── [email protected] | |
│ ├─┬ [email protected] | |
│ │ ├── [email protected] | |
│ │ ├── [email protected] | |
│ │ ├── [email protected] | |
│ │ ├─┬ [email protected] | |
│ │ │ ├── [email protected] | |
│ │ │ └─┬ [email protected] | |
│ │ │ └── [email protected] | |
│ │ ├─┬ [email protected] | |
│ │ │ ├── [email protected] | |
│ │ │ ├── [email protected] | |
│ │ │ ├── [email protected] | |
│ │ │ └── [email protected] | |
│ │ ├── [email protected] | |
│ │ ├── [email protected] | |
│ │ ├── [email protected] | |
│ │ ├── [email protected] | |
│ │ ├── [email protected] | |
│ │ └── [email protected] | |
│ └── [email protected] | |
├─┬ [email protected] | |
│ ├── [email protected] | |
│ ├─┬ [email protected] | |
│ │ ├─┬ [email protected] | |
│ │ │ └─┬ [email protected] | |
│ │ │ ├── [email protected] | |
│ │ │ └── [email protected] | |
│ │ └─┬ [email protected] | |
│ │ ├── [email protected] | |
│ │ └── [email protected] | |
│ ├── [email protected] | |
│ ├── [email protected] | |
│ ├── [email protected] | |
│ └── [email protected] | |
└─┬ [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├─┬ [email protected] | |
│ └── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├─┬ [email protected] | |
│ └── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├─┬ [email protected] | |
│ └── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├─┬ [email protected] | |
│ └── [email protected] | |
├─┬ [email protected] | |
│ └─┬ [email protected] | |
│ └── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├─┬ [email protected] | |
│ └── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
└── [email protected] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment