MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / testConventions

Function testConventions

test/objectwrap.js:137–155  ·  view source on GitHub ↗
(obj, clazz)

Source from the content-addressed store, hash-verified

135 };
136
137 const testConventions = (obj, clazz) => {
138 // test @@toStringTag
139 {
140 assert.strictEqual(obj[Symbol.toStringTag], 'TestTag');
141 assert.strictEqual('' + obj, '[object TestTag]');
142 }
143
144 // test @@iterator
145 {
146 obj.testSetter = 'iterator';
147 const values = [];
148
149 for (const item of obj) {
150 values.push(item);
151 }
152
153 assert.deepEqual(values, ['iterator']);
154 }
155 };
156
157 const testStaticValue = (clazz) => {
158 assert.strictEqual(clazz.testStaticValue, 'value');

Callers 1

testObjFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected