From a5f90ac7ecda04847bd8569d6135d902ae3bd645 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Sun, 28 Jan 2018 22:30:21 +0100 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20faked-promise?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- test/index.spec.js | 16 +++++++--------- yarn.lock | 6 +++--- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 930bc44..4989789 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "codecov": "^3.0.0", "eslint": "^4.16.0", "eslint-config-posva": "^1.3.2", - "faked-promise": "^1.0.0", + "faked-promise": "^2.0.0", "jest": "^22.1.4", "vue": "^2.5.13", "vue-jest": "^2.0.0", diff --git a/test/index.spec.js b/test/index.spec.js index fa5a803..7e42059 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -8,8 +8,8 @@ describe('Promised', () => { let wrapper describe('single promise', () => { let promise, resolve, reject - beforeEach(async () => { - [promise, resolve, reject] = await fakePromise() + beforeEach(() => { + [promise, resolve, reject] = fakePromise() wrapper = mount(Helper, { propsData: { promise, @@ -34,7 +34,7 @@ describe('Promised', () => { }) test('cancels previous promise', async () => { - const other = await fakePromise() + const other = fakePromise() wrapper.setProps({ promise: other[0] }) resolve('foo') await tick() @@ -42,7 +42,7 @@ describe('Promised', () => { }) test('cancels previous rejected promise', async () => { - const other = await fakePromise() + const other = fakePromise() wrapper.setProps({ promise: other[0] }) reject(new Error('failed')) await tick() @@ -53,9 +53,7 @@ describe('Promised', () => { describe('multiple promise', () => { let fakedPromises beforeEach(async () => { - fakedPromises = (await Promise.all( - Array.from({ length: 3 }, () => fakePromise()) - )).map(([promise, resolve, reject]) => ({ + fakedPromises = Array.from({ length: 3 }, () => fakePromise()).map(([promise, resolve, reject]) => ({ promise, resolve, reject, @@ -94,7 +92,7 @@ describe('Promised', () => { }) test('cancels previous promise', async () => { - const other = await fakePromise() + const other = fakePromise() wrapper.setProps({ promises: [other[0]] }) fakedPromises[0].resolve('foo') await tick() @@ -102,7 +100,7 @@ describe('Promised', () => { }) test('cancels previous rejected promise', async () => { - const other = await fakePromise() + const other = fakePromise() wrapper.setProps({ promises: [other[0]] }) fakedPromises[0].reject(new Error('failed')) await tick() diff --git a/yarn.lock b/yarn.lock index e718d28..b9cc3aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1470,9 +1470,9 @@ extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" -faked-promise@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/faked-promise/-/faked-promise-1.0.0.tgz#5b7e93c422be46d9bdd1f8ae1293cb709ca352c0" +faked-promise@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/faked-promise/-/faked-promise-2.0.0.tgz#57f929e4363deee7debb4d3242d4ab0c607cdfaa" fast-deep-equal@^1.0.0: version "1.0.0"