Skip to content

Commit 8a0b994

Browse files
devsnekjasnell
authored andcommitted
test: remove expectations based on v8 headers from types test
PR-URL: #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 faf563e commit 8a0b994

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

test/parallel/test-util-types.js

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

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

0 commit comments

Comments
 (0)