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>
This commit is contained in:
Daniel Bevenius 2017-06-15 14:51:05 +02:00
parent 282b1edbe7
commit a8979a6054
5 changed files with 25 additions and 2 deletions

View File

@ -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)

View File

@ -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) {

View File

@ -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');

View File

@ -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');

View File

@ -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;