@js-bits/xpromise
Advanced tools
Comparing version 0.3.0 to 0.3.1
import ExtendablePromise from '../index.js'; | ||
// const ExtendablePromise = require('../dist/index.cjs'); | ||
@@ -3,0 +4,0 @@ class MyPromise extends ExtendablePromise { |
@@ -6,3 +6,3 @@ // eslint-disable-next-line import/no-extraneous-dependencies | ||
beforeEach(() => { | ||
global.console = { log: jest.fn() }; | ||
console = { log: jest.fn() }; | ||
}); | ||
@@ -16,2 +16,3 @@ afterEach(() => { | ||
await import('./example1.js'); | ||
// await require('./example1.js'); | ||
expect(console.log).toHaveBeenCalledTimes(3); | ||
@@ -18,0 +19,0 @@ expect(console.log.mock.calls[0]).toEqual([true]); |
@@ -185,2 +185,8 @@ /* eslint-disable max-classes-per-file */ | ||
}); | ||
test('should return only first argument', () => { | ||
expect.assertions(1); | ||
return promise.resolve(11, 22, 33).then((...args) => { | ||
expect(args).toEqual([11]); | ||
}); | ||
}); | ||
describe('when bound to another promise', () => { | ||
@@ -356,2 +362,9 @@ test('should return resolved promise', async () => { | ||
}); | ||
test('should return only first argument', () => { | ||
expect.assertions(1); | ||
const promise = Promise.resolve(1, 2, 3); | ||
return promise.then((...args) => { | ||
expect(args).toEqual([1]); | ||
}); | ||
}); | ||
}); | ||
@@ -358,0 +371,0 @@ describe('Promise.reject', () => { |
{ | ||
"name": "@js-bits/xpromise", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Extendable Promise", | ||
@@ -36,9 +36,9 @@ "keywords": [ | ||
"devDependencies": { | ||
"@js-bits/formalinter": "^0.3.1", | ||
"@js-bits/formalinter": "^1.0.3", | ||
"@js-bits/log-in-color": "^0.3.1", | ||
"@types/jest": "^29.1.1", | ||
"husky": "^8.0.1", | ||
"jest": "^29.1.2", | ||
"jest-environment-jsdom": "^29.1.2", | ||
"rollup": "^2.79.1" | ||
"@types/jest": "^29.5.1", | ||
"husky": "^8.0.3", | ||
"jest": "^29.5.0", | ||
"jest-environment-jsdom": "^29.5.0", | ||
"rollup": "^3.23.0" | ||
}, | ||
@@ -65,4 +65,4 @@ "engines": { | ||
"dependencies": { | ||
"@js-bits/enumerate": "^0.8.0" | ||
"@js-bits/enumerate": "^0.10.0" | ||
} | ||
} |
@@ -51,3 +51,2 @@ # Extendable Promise | ||
- Does not include any polyfills, which means that Internet Explorer is not supported. | ||
- [Alternative solution](https://stackoverflow.com/questions/48158730/extend-javascript-promise-and-resolve-or-reject-it-inside-constructor) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21697
12
577
52
+ Added@js-bits/enumerate@0.10.0(transitive)
- Removed@js-bits/enumerate@0.8.4(transitive)
Updated@js-bits/enumerate@^0.10.0