From 781d891939fabf5ac2be0ecc9a7c8ba1ef62c9c8 Mon Sep 17 00:00:00 2001 From: eric_wang Date: Wed, 9 Mar 2022 18:14:09 +0800 Subject: [PATCH] fix: Compatible with node low version test --- .idea/vcs.xml | 6 ++++ .idea/workspace.xml | 73 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + test/test.ts | 3 +- 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..1fa8fb1 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1645820743983 + + + + + + + + + \ No newline at end of file diff --git a/package.json b/package.json index d07c4b4..a1f4653 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "@types/zen-observable": "^0.8.0", "@typescript-eslint/eslint-plugin": "^2.20.0", "@typescript-eslint/parser": "^2.20.0", + "@ungap/weakrefs": "^0.2.0", "ava": "^3.3.0", "del-cli": "^2.0.0", "eslint-config-xo-typescript": "^0.26.0", diff --git a/test/test.ts b/test/test.ts index 113be26..f9b6091 100644 --- a/test/test.ts +++ b/test/test.ts @@ -7,6 +7,7 @@ import {JSDOM} from 'jsdom'; import {Subject, Observable} from 'rxjs'; import tempy = require('tempy'); import ZenObservable = require('zen-observable'); +import {WeakRef} from '@ungap/weakrefs' import is, {assert, AssertionTypeDescription, Primitive, TypedArray, TypeName} from '../source'; class PromiseSubclassFixture extends Promise {} @@ -339,7 +340,7 @@ const types = new Map([ is: is.weakRef, assert: assert.weakRef, fixtures: [ - new window.WeakRef({}) + window.WeakRef ? new window.WeakRef({}) : new WeakRef({}) ], typename: 'WeakRef' }],