Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ Checks for 'openssl'.

Checks `hasCrypto` and `crypto` with fips.

### hasIntl
* return [<Boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)

Checks if [internationalization] is supported.

### hasSmallICU
* return [<Boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)

Checks `hasIntl` and `small-icu` is supported.

### hasIPv6
* return [<Boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)

Expand Down Expand Up @@ -322,3 +332,4 @@ implementation with tests from
[W3C Web Platform Tests](https://github.com/w3c/web-platform-tests).

[MDN-Function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Normal_objects_and_functions
[internationalization]: https://github.com/nodejs/node/wiki/Intl
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)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is common.hasSmallICU a thing? I'm only finding process.binding('config').hasSmallICU with a quick search.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I was looking at an old commit and did not notice that that function does not exist or has been removed. Going to add it now. Thanks.

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