-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for deprecated data option
- Loading branch information
1 parent
8787e88
commit f7a100b
Showing
6 changed files
with
36 additions
and
2 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- '10' | ||
- '8' | ||
- '7' | ||
- '6' | ||
before_install: | ||
- npm install -g yarn@1.10.0 | ||
|
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
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,26 @@ | ||
const { expect } = require('chai') | ||
const property = require('prop-factory') | ||
|
||
const gimme = require('..') | ||
const { url } = require('./00-setup') | ||
|
||
describe('data', () => { | ||
const body = { baz: 'bop' } | ||
const res = property() | ||
|
||
beforeEach(() => { | ||
res(undefined) | ||
}) | ||
|
||
beforeEach(() => | ||
gimme({ data: body, method: 'POST', url }).then(res) | ||
) | ||
|
||
it('is used for non-GET request body', () => | ||
expect(res().body.body).to.eql(body) | ||
) | ||
|
||
it('is deprecated', () => | ||
expect(console.warn.calls[0][0]).to.include('deprecated') | ||
) | ||
}) |
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