Skip to content

Commit 1fdb73e

Browse files
devsnekBridgeAR
authored andcommitted
test: remove expectations based on v8 headers from types test
PR-URL: nodejs#20003 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent b2a7e20 commit 1fdb73e

1 file changed

Lines changed: 0 additions & 37 deletions

File tree

test/parallel/test-util-types.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ const common = require('../common');
44
const fixtures = require('../common/fixtures');
55
const assert = require('assert');
66
const { types, inspect } = require('util');
7-
const path = require('path');
8-
const fs = require('fs');
97
const vm = require('vm');
108
const { JSStream } = process.binding('js_stream');
119

@@ -125,38 +123,3 @@ for (const [ value, _method ] of [
125123
assert.deepStrictEqual(yup, expected[testedFunc]);
126124
}
127125
}
128-
129-
130-
// Try reading the v8.h header to verify completeness.
131-
132-
let v8_h;
133-
try {
134-
v8_h = fs.readFileSync(path.resolve(
135-
__dirname, '..', '..', 'deps', 'v8', 'include', 'v8.h'), 'utf8');
136-
} catch (e) {
137-
// If loading the header fails, it should fail because we did not find it.
138-
assert.strictEqual(e.code, 'ENOENT');
139-
common.skip('Could not read v8.h');
140-
return;
141-
}
142-
143-
// Exclude a number of checks that make sense on the C++ side but have
144-
// much faster/better JS equivalents, so they should not be exposed.
145-
const exclude = [
146-
'Undefined', 'Null', 'NullOrUndefined', 'True', 'False', 'Name', 'String',
147-
'Symbol', 'Function', 'Array', 'Object', 'Boolean', 'Number', 'Int32',
148-
'Uint32'
149-
];
150-
151-
const start = v8_h.indexOf('Value : public Data');
152-
const end = v8_h.indexOf('};', start);
153-
const valueDefinition = v8_h.substr(start, end - start);
154-
155-
const re = /bool Is(\w+)\(\)/g;
156-
let match;
157-
while (match = re.exec(valueDefinition)) {
158-
if (exclude.includes(match[1]))
159-
continue;
160-
assert(`is${match[1]}` in types,
161-
`util.types should provide check for Is${match[1]}`);
162-
}

0 commit comments

Comments
 (0)