-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
449 additions
and
37 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
var sails = require('sails'); | ||
|
||
before(function(done) { | ||
|
||
// Increase the Mocha timeout so that Sails has enough time to lift. | ||
this.timeout(5000); | ||
|
||
sails.lift({ | ||
port: 1339, | ||
environment: 'test', | ||
connections: { | ||
testDB: { | ||
adapter: 'sails-memory' | ||
} | ||
}, | ||
models: { | ||
connection: 'testDB' | ||
}, | ||
}, function(err) { | ||
if (err) return done(err); | ||
// here you can load fixtures, etc. | ||
done(err, sails); | ||
}); | ||
}); | ||
|
||
after(function(done) { | ||
// here you can clear fixtures, etc. | ||
sails.lower(done); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var request = require('supertest'); | ||
var expect = require('expect'); | ||
|
||
describe('JobController', function() { | ||
|
||
describe('GET /job', function() { | ||
it('should return all Jobs', function (done) { | ||
request(sails.hooks.http.app) | ||
.get('/job') | ||
.expect(200) | ||
.then((response) => { | ||
expect(response.body).toEqual([]); | ||
done(); | ||
}).catch(err => { | ||
expect(err).not.toBeDefined() | ||
done() | ||
}) | ||
}); | ||
}); | ||
|
||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
describe('JobModel', function () { | ||
|
||
describe('#find()', function () { | ||
it('should check find function', function (done) { | ||
Job.find() | ||
.then(function (results) { | ||
// some tests | ||
done(); | ||
}) | ||
.catch(done); | ||
}); | ||
}); | ||
|
||
}); |
Oops, something went wrong.