Skip to content

Commit

Permalink
test: add hasIntl to failing test
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
danbev authored and addaleax committed Jun 18, 2017
1 parent 807e8b7 commit 5b4bbfa
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
5 changes: 5 additions & 0 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 6 additions & 0 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-icu-data-dir.js
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-url-domain-ascii-unicode.js
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
4 changes: 4 additions & 0 deletions test/parallel/test-url-format-whatwg.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 5b4bbfa

Please sign in to comment.