From 5cec2d4cb050315f1c0ecd5d87604edc38da8722 Mon Sep 17 00:00:00 2001 From: Gabriel Gunullu <64731573+ggunullu@users.noreply.github.com> Date: Thu, 20 Oct 2022 16:46:56 +0200 Subject: [PATCH] test(coalesce-calls): from Jest to test (#6470) --- .../{index.spec.js => index.test.js} | 10 ++++++---- @vates/coalesce-calls/package.json | 6 +++++- yarn.lock | 20 +++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) rename @vates/coalesce-calls/{index.spec.js => index.test.js} (69%) diff --git a/@vates/coalesce-calls/index.spec.js b/@vates/coalesce-calls/index.test.js similarity index 69% rename from @vates/coalesce-calls/index.spec.js rename to @vates/coalesce-calls/index.test.js index 1fe505d7d..76e751101 100644 --- a/@vates/coalesce-calls/index.spec.js +++ b/@vates/coalesce-calls/index.test.js @@ -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') }) }) diff --git a/@vates/coalesce-calls/package.json b/@vates/coalesce-calls/package.json index 000e79341..4833aa104 100644 --- a/@vates/coalesce-calls/package.json +++ b/@vates/coalesce-calls/package.json @@ -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" } } diff --git a/yarn.lock b/yarn.lock index c55cdf4cf..57d968939 100644 --- a/yarn.lock +++ b/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"