Browse Source

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: https://github.com/nodejs/node/pull/13699
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Daniel Bevenius 7 years ago
parent
commit
a8979a6054
  1. 5
      test/common/README.md
  2. 6
      test/common/index.js
  3. 6
      test/parallel/test-icu-data-dir.js
  4. 6
      test/parallel/test-url-domain-ascii-unicode.js
  5. 4
      test/parallel/test-url-format-whatwg.js

5
test/common/README.md

@ -111,6 +111,11 @@ Checks `hasCrypto` and `crypto` with fips.
Checks if [internationalization] is supported.
### hasSmallICU
* return [&lt;Boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)
Checks `hasIntl` and `small-icu` is supported.
### hasIPv6
* return [&lt;Boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)

6
test/common/index.js

@ -689,6 +689,12 @@ Object.defineProperty(exports, 'hasIntl', {
}
});
Object.defineProperty(exports, 'hasSmallICU', {
get: function() {
return process.binding('config').hasSmallICU;
}
});
// Useful for testing expected internal/error objects
exports.expectsError = function expectsError({code, type, message}) {
return function(error) {

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

@ -1,5 +1,9 @@
'use strict';
require('../common');
const common = require('../common');
if (!(common.hasIntl && common.hasSmallICU)) {
common.skip('missing Intl');
return;
}
const assert = require('assert');
const { spawnSync } = require('child_process');

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

@ -1,6 +1,10 @@
'use strict';
require('../common');
const common = require('../common');
if (!common.hasIntl) {
common.skip('missing Intl');
return;
}
const strictEqual = require('assert').strictEqual;
const url = require('url');

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

@ -1,6 +1,10 @@
'use strict';
const common = require('../common');
if (!common.hasIntl) {
common.skip('missing Intl');
return;
}
const assert = require('assert');
const url = require('url');
const URL = url.URL;

Loading…
Cancel
Save