-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix missing util for mocha (#317)
* fix: fix missing util for mocha simplify with mocha-2018 bundle. * chore: lock
- Loading branch information
1 parent
36dac27
commit cd6d140
Showing
7 changed files
with
303 additions
and
555 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,14 +1,14 @@ | ||
/* eslint-disable no-undef */ | ||
// eslint-disable-next-line strict | ||
const assert = require('assert') | ||
const { is } = require('uvu/assert') | ||
|
||
const { KV } = require('./sw-globals') | ||
|
||
describe('sw', () => { | ||
it('should intercept and return kv and env', async () => { | ||
const out = await fetch('/favicon.ico') | ||
const data = await out.json() | ||
assert.strictEqual(data.env.browser, 'chromium') | ||
assert.strictEqual(data.kv.test, KV.test) | ||
is(data.env.browser, 'chromium') | ||
is(data.kv.test, KV.test) | ||
}) | ||
}) |
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,30 +1,30 @@ | ||
/* eslint-disable no-undef */ | ||
// eslint-disable-next-line strict | ||
const assert = require('assert') | ||
const { is } = require('uvu/assert') | ||
const debug = require('debug')('app') | ||
const { good, bad } = require('./lib') | ||
|
||
describe('Array', () => { | ||
describe('#indexOf()', () => { | ||
it('should return -1 when the value is not present', () => { | ||
assert.equal([1, 2, 3].indexOf(4), -1) | ||
is([1, 2, 3].indexOf(4), -1) | ||
}) | ||
|
||
it('should fail ', () => { | ||
assert.strictEqual([1, 2, 3].indexOf(2), 1) | ||
is([1, 2, 3].indexOf(2), 1) | ||
}) | ||
|
||
it('should pass with debug', () => { | ||
assert.equal([1, 2, 3].indexOf(4), -1) | ||
is([1, 2, 3].indexOf(4), -1) | ||
debug('test pass') | ||
}) | ||
|
||
it('should return "good"', async () => { | ||
assert.strictEqual(await good(), 'good') | ||
is(await good(), 'good') | ||
}) | ||
|
||
it('should return "bad"', async () => { | ||
assert.strictEqual(await bad(), 'bad') | ||
is(await bad(), 'bad') | ||
}) | ||
}) | ||
}) |
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
Oops, something went wrong.