Skip to content

Commit

Permalink
Merge pull request #78 from davidgovea/repair-build
Browse files Browse the repository at this point in the history
Housekeeping - get build/tests running
  • Loading branch information
niftylettuce committed Feb 14, 2019
2 parents 8a8e167 + 52310f9 commit 5a5aada
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"presets": [
["@babel/env", {
"targets": {
"node": "6.4.0"
"node": "6.4.0",
"browsers": "last 2 versions"
}
}]
],
"plugins": [
[ "@babel/transform-runtime", {
"helpers": false,
"polyfill": false,
"regenerator": true
}],
"@babel/plugin-proposal-object-rest-spread"
Expand Down
1 change: 0 additions & 1 deletion .browserslistrc

This file was deleted.

2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ node_js:
- '8'
- '9'
- '10'
install:
- yarn install --ignore-engines
script:
npm run test-coverage
after_success:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@
"capitalized-comments": "off",
"camelcase": "off",
"no-warning-comments": "off",
"prettier/prettier": "error"
"prettier/prettier": "error",
"ava/use-t-well": "off"
},
"space": true,
"overrides": [
Expand Down
18 changes: 9 additions & 9 deletions test/node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test('should accept valid auth("user:pass") usage', t => {

test('should allow chaining of `auth` and an HTTP method', async t => {
const api = new Frisbee(options);
await t.notThrows(api.auth('foo', 'bar').get('/'));
await t.notThrows(() => api.auth('foo', 'bar').get('/'));
});

test('should allow removal of auth() header', t => {
Expand All @@ -68,29 +68,29 @@ test('should allow removal of auth() header', t => {

test('should throw an error if we fail to pass a string `path`', async t => {
const api = new Frisbee(options);
const error = await t.throws(api.get({}));
const error = await t.throwsAsync(api.get({}));
t.is(error.message, '`path` must be a string');
});

test(`should throw an error if we fail to pass an object options`, async t => {
const api = new Frisbee(options);
let error = await t.throws(api.get('', []));
let error = await t.throwsAsync(() => api.get('', []));
t.is(error.message, '`options` must be an object');
error = await t.throws(api.get('', 1));
error = await t.throwsAsync(() => api.get('', 1));
t.is(error.message, '`options` must be an object');
});

test('should throw an error if we pass a non object `options`', async t => {
const api = new Frisbee(options);
const error = await t.throws(api.get('', false));
const error = await t.throwsAsync(() => api.get('', false));
t.is(error.message, '`options` must be an object');
});

test(
oneLine`should automatically set options to an empty object if not set`,
async t => {
const api = new Frisbee(options);
await t.notThrows(api.get(''));
await t.notThrows(() => api.get(''));
}
);

Expand All @@ -99,9 +99,9 @@ test(
if headers with value ""|null|undefined`,
async t => {
const api = new Frisbee(options);
await t.notThrows(api.get('', { headers: { empty: '' } }));
await t.notThrows(api.get('', { headers: { null: null } }));
await t.notThrows(api.get('', { headers: { undefine: undefined } }));
await t.notThrows(() => api.get('', { headers: { empty: '' } }));
await t.notThrows(() => api.get('', { headers: { null: null } }));
await t.notThrows(() => api.get('', { headers: { undefine: undefined } }));
}
);

Expand Down

0 comments on commit 5a5aada

Please sign in to comment.