@js-bits/xpromise
Advanced tools
Comparing version 0.3.0 to 0.3.2
@@ -0,2 +1,4 @@ | ||
/* eslint-disable no-console */ | ||
import ExtendablePromise from '../index.js'; | ||
// const ExtendablePromise = require('../dist/index.cjs'); | ||
@@ -3,0 +5,0 @@ class MyPromise extends ExtendablePromise { |
@@ -1,2 +0,2 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
/* eslint-disable import/no-extraneous-dependencies, no-console */ | ||
import { jest } from '@jest/globals'; | ||
@@ -6,3 +6,3 @@ | ||
beforeEach(() => { | ||
global.console = { log: jest.fn() }; | ||
jest.spyOn(console, 'log'); | ||
}); | ||
@@ -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]); |
@@ -1,3 +0,2 @@ | ||
/* eslint-disable max-classes-per-file */ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
/* eslint-disable max-classes-per-file, import/no-extraneous-dependencies, no-unused-vars */ | ||
import { jest } from '@jest/globals'; | ||
@@ -185,2 +184,8 @@ import ExtendablePromise from './index.js'; | ||
}); | ||
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 +361,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 +370,0 @@ describe('Promise.reject', () => { |
{ | ||
"name": "@js-bits/xpromise", | ||
"version": "0.3.0", | ||
"version": "0.3.2", | ||
"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
21721
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