10000 [Tests] allow tests to pass if zero traps are triggered · inspect-js/is-regex@ad5ee56 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad5ee56

Browse files
committed
[Tests] allow tests to pass if zero traps are triggered
Closes #35
1 parent 46bfdc9 commit ad5ee56

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ test('does not perform operations observable to Proxies', { skip: typeof Proxy !
8787
var proxy = new Proxy({ lastIndex: 0 }, handler);
8888

8989
st.equal(isRegex(proxy), false, 'proxy of plain object is not regex');
90-
st.deepEqual(handler.trapCalls, ['getOwnPropertyDescriptor'], 'no unexpected proxy traps were triggered');
90+
st.deepEqual(
91+
handler.trapCalls,
92+
handler.trapCalls.length > 0 ? ['getOwnPropertyDescriptor'] : [],
93+
'no unexpected proxy traps were triggered'
94+
);
9195
st.end();
9296
});
9397

@@ -96,7 +100,11 @@ test('does not perform operations observable to Proxies', { skip: typeof Proxy !
96100
var proxy = new Proxy(/a/, handler);
97101

98102
st.equal(isRegex(proxy), false, 'proxy of RegExp instance is not regex');
99-
st.deepEqual(handler.trapCalls, ['getOwnPropertyDescriptor'], 'no unexpected proxy traps were triggered');
103+
st.deepEqual(
104+
handler.trapCalls,
105+
handler.trapCalls.length > 0 ? ['getOwnPropertyDescriptor'] : [],
106+
'no unexpected proxy traps were triggered'
107+
);
100108
st.end();
101109
});
102110

0 commit comments

Comments
 (0)
0