We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ea64bb commit 306bdf7Copy full SHA for 306bdf7
test/parallel/test-uv-errmap.js
@@ -0,0 +1,24 @@
1
+// Flags: --expose-internals
2
+'use strict';
3
+
4
+const common = require('../common');
5
+const assert = require('assert');
6
+const {
7
+ getSystemErrorMap,
8
+ _errnoException
9
+} = require('util');
10
11
+const { internalBinding } = require('internal/test/binding');
12
+const uv = internalBinding('uv');
13
+const uvKeys = Object.keys(uv);
14
15
+const errMap = getSystemErrorMap();
16
17
+uvKeys.forEach((key) => {
18
+ if (!key.startsWith('UV_'))
19
+ return;
20
21
+ const err = _errnoException(uv[key]);
22
+ const name = uv.errname(uv[key]);
23
+ assert.strictEqual(errMap.get(err.errno)[0], name);
24
+});
0 commit comments