mirror of
https://github.com/typicode/json-server.git
synced 2025-07-27 20:23:34 +08:00
31 lines
725 B
JavaScript
31 lines
725 B
JavaScript
var request = require('supertest'),
|
|
assert = require('assert'),
|
|
server = require('../server'),
|
|
routes = require('../routes/read-write'),
|
|
app;
|
|
|
|
describe('Static routes', function() {
|
|
|
|
beforeEach(function() {
|
|
app = server.createApp({}, routes);
|
|
});
|
|
|
|
describe('GET /', function() {
|
|
it('should respond with html', function(done) {
|
|
request(app)
|
|
.get('/')
|
|
.expect('Content-Type', /html/)
|
|
.expect(200, done);
|
|
});
|
|
});
|
|
|
|
describe('GET /stylesheets/style.css', function() {
|
|
it('should respond with css', function(done) {
|
|
request(app)
|
|
.get('/stylesheets/style.css')
|
|
.expect('Content-Type', /css/)
|
|
.expect(200, done);
|
|
});
|
|
});
|
|
|
|
}); |