Skip to content

Commit 85e4bca

Browse files
committed
test: add schema validation and process.versions.ata tests
1 parent 4499bd3 commit 85e4bca

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"nodeOptions": {
3+
"max-old-space-size": "not-a-number"
4+
}
5+
}

test/parallel/test-ata-version.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
require('../common');
4+
const assert = require('assert');
5+
6+
// Verify that ata-validator is available in process.versions
7+
assert.ok(process.versions.ata, 'process.versions.ata should be defined');
8+
assert.match(process.versions.ata, /^\d+\.\d+\.\d+$/,
9+
'process.versions.ata should be a semver string');

test/parallel/test-config-file.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,3 +605,21 @@ describe('namespace-scoped options', () => {
605605
assert.strictEqual(result.code, 0);
606606
});
607607
});
608+
609+
test('should reject config with schema validation errors', async () => {
610+
const result = await spawnPromisified(process.execPath, [
611+
'--experimental-config-file',
612+
fixtures.path('rc/invalid-schema-type.json'),
613+
'-p', '"Hello"',
614+
]);
615+
assert.match(result.stderr, /Invalid configuration/);
616+
assert.strictEqual(result.code, 9);
617+
});
618+
619+
test('process.versions.ata should be defined', async () => {
620+
const result = await spawnPromisified(process.execPath, [
621+
'-p', 'process.versions.ata',
622+
]);
623+
assert.match(result.stdout, /\d+\.\d+\.\d+/);
624+
assert.strictEqual(result.code, 0);
625+
});

test/parallel/test-process-versions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const expected_keys = [
2525
'ada',
2626
'nbytes',
2727
'merve',
28+
'ata',
2829
];
2930

3031

0 commit comments

Comments
 (0)