-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ignore $schema definition * added tests that verify $schema node is ignored * reduced schema ignore tests (copied from other tests) --------- Co-authored-by: Eric Newton <eric.newton@centralsquare.com>
- Loading branch information
1 parent
b9b2c49
commit 64f8698
Showing
3 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const request = require('supertest') | ||
const jsonServer = require('../../src/server') | ||
|
||
describe('$schema-ignore', () => { | ||
let server | ||
let router | ||
let db | ||
|
||
beforeEach(() => { | ||
db = { | ||
$schema: 'http://some.schema.somewhere/', | ||
} | ||
|
||
db.user = { | ||
name: 'foo', | ||
email: 'foo@example.com', | ||
} | ||
|
||
server = jsonServer.create() | ||
router = jsonServer.router(db) | ||
server.use(jsonServer.defaults()) | ||
server.use(router) | ||
}) | ||
|
||
test('doesnt error with $schema node', () => { | ||
return request(server).get('/user').expect(200, db.user) | ||
}) | ||
}) |
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