test(coalesce-calls): from Jest to test (#6470)
This commit is contained in:
parent
ed76fa5141
commit
5cec2d4cb0
@ -1,6 +1,8 @@
|
||||
'use strict'
|
||||
|
||||
/* eslint-env jest */
|
||||
// eslint-disable-next-line n/no-unpublished-require
|
||||
const { describe, it } = require('test')
|
||||
const assert = require('assert')
|
||||
|
||||
const { coalesceCalls } = require('./')
|
||||
|
||||
@ -23,13 +25,13 @@ describe('coalesceCalls', () => {
|
||||
const promise2 = fn(defer2.promise)
|
||||
|
||||
defer1.resolve('foo')
|
||||
expect(await promise1).toBe('foo')
|
||||
expect(await promise2).toBe('foo')
|
||||
assert.strictEqual(await promise1, 'foo')
|
||||
assert.strictEqual(await promise2, 'foo')
|
||||
|
||||
const defer3 = pDefer()
|
||||
const promise3 = fn(defer3.promise)
|
||||
|
||||
defer3.resolve('bar')
|
||||
expect(await promise3).toBe('bar')
|
||||
assert.strictEqual(await promise3, 'bar')
|
||||
})
|
||||
})
|
@ -30,6 +30,10 @@
|
||||
"node": ">=8.10"
|
||||
},
|
||||
"scripts": {
|
||||
"postversion": "npm publish --access public"
|
||||
"postversion": "npm publish --access public",
|
||||
"test": "node--test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"test": "^3.2.1"
|
||||
}
|
||||
}
|
||||
|
20
yarn.lock
20
yarn.lock
@ -17207,6 +17207,18 @@ string.prototype.matchall@^4.0.7:
|
||||
regexp.prototype.flags "^1.4.1"
|
||||
side-channel "^1.0.4"
|
||||
|
||||
string.prototype.replaceall@^1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/string.prototype.replaceall/-/string.prototype.replaceall-1.0.6.tgz#566cba7c413713d0b1a85c5dba98b31f8db38196"
|
||||
integrity sha512-OA8VDhE7ssNFlyoDXUHxw6V5cjgPrtosyJKqJX5i1P5tV9eUynsbhx1yz0g+Ye4fjFwAxhKLxt8GSRx2Aqc+Sw==
|
||||
dependencies:
|
||||
call-bind "^1.0.2"
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.19.1"
|
||||
get-intrinsic "^1.1.1"
|
||||
has-symbols "^1.0.2"
|
||||
is-regex "^1.1.4"
|
||||
|
||||
string.prototype.trim@^1.2.1:
|
||||
version "1.2.6"
|
||||
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.6.tgz#824960787db37a9e24711802ed0c1d1c0254f83e"
|
||||
@ -17691,6 +17703,14 @@ test-exclude@^6.0.0:
|
||||
glob "^7.1.4"
|
||||
minimatch "^3.0.4"
|
||||
|
||||
test@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/test/-/test-3.2.1.tgz#8876adae35e86c4bccbcfdf5b018493b1c9501be"
|
||||
integrity sha512-D9eN4OxdhyYS3xHSsAh5A0e+UhaOPxeREwBHTknZHoVFd4TqnPtkVrQ7lIUATPgpO9vvGg1D+TyMckVmUyaEig==
|
||||
dependencies:
|
||||
minimist "^1.2.6"
|
||||
string.prototype.replaceall "^1.0.6"
|
||||
|
||||
tether@^1.3.7:
|
||||
version "1.4.7"
|
||||
resolved "https://registry.yarnpkg.com/tether/-/tether-1.4.7.tgz#d56a818590d8fe72e387f77a67f93ab96d8e1fb2"
|
||||
|
Loading…
Reference in New Issue
Block a user