Skip to content

Commit 0d3b52e

Browse files
danbevaddaleax
authored andcommitted
test: add hasIntl to failing test
Currently when node is configured --without-intl the tests in this commit fail. This commit adds checks for internationalization for these tests PR-URL: #13699 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 61714ac commit 0d3b52e

5 files changed

+25
-2
lines changed

test/common/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ Checks `hasCrypto` and `crypto` with fips.
111111

112112
Checks if [internationalization] is supported.
113113

114+
### hasSmallICU
115+
* return [&lt;Boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)
116+
117+
Checks `hasIntl` and `small-icu` is supported.
118+
114119
### hasIPv6
115120
* return [&lt;Boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)
116121

test/common/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,12 @@ Object.defineProperty(exports, 'hasIntl', {
689689
}
690690
});
691691

692+
Object.defineProperty(exports, 'hasSmallICU', {
693+
get: function() {
694+
return process.binding('config').hasSmallICU;
695+
}
696+
});
697+
692698
// Useful for testing expected internal/error objects
693699
exports.expectsError = function expectsError({code, type, message}) {
694700
return function(error) {

test/parallel/test-icu-data-dir.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'use strict';
2-
require('../common');
2+
const common = require('../common');
3+
if (!(common.hasIntl && common.hasSmallICU)) {
4+
common.skip('missing Intl');
5+
return;
6+
}
37
const assert = require('assert');
48
const { spawnSync } = require('child_process');
59

test/parallel/test-url-domain-ascii-unicode.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
'use strict';
22

3-
require('../common');
3+
const common = require('../common');
4+
if (!common.hasIntl) {
5+
common.skip('missing Intl');
6+
return;
7+
}
48
const strictEqual = require('assert').strictEqual;
59
const url = require('url');
610

test/parallel/test-url-format-whatwg.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasIntl) {
5+
common.skip('missing Intl');
6+
return;
7+
}
48
const assert = require('assert');
59
const url = require('url');
610
const URL = url.URL;

0 commit comments

Comments
 (0)