|
1 | 1 | import assert from 'assert';
|
2 | 2 | import Ajv2020 from 'ajv/dist/2020';
|
3 |
| -import InternalToStandardConvertor, { RELAXED_EJSON_DEFINITIONS } from './internalToStandard'; |
| 3 | +import InternalToStandardConverter, { RELAXED_EJSON_DEFINITIONS } from './internalToStandard'; |
4 | 4 |
|
5 | 5 | describe('internalSchemaToStandard', async function() {
|
6 | 6 | const ajv = new Ajv2020();
|
@@ -895,8 +895,8 @@ describe('internalSchemaToStandard', async function() {
|
895 | 895 | }
|
896 | 896 | ]
|
897 | 897 | };
|
898 |
| - const convertor = new InternalToStandardConvertor(); |
899 |
| - const standard = await convertor.convert(internal); |
| 898 | + const converter = new InternalToStandardConverter(); |
| 899 | + const standard = await converter.convert(internal); |
900 | 900 | ajv.validateSchema(standard);
|
901 | 901 | const expectedDefinitions: any = {
|
902 | 902 | ...RELAXED_EJSON_DEFINITIONS
|
@@ -1117,8 +1117,8 @@ describe('internalSchemaToStandard', async function() {
|
1117 | 1117 | }
|
1118 | 1118 | ]
|
1119 | 1119 | };
|
1120 |
| - const convertor = new InternalToStandardConvertor(); |
1121 |
| - const standard = await convertor.convert(internal); |
| 1120 | + const converter = new InternalToStandardConverter(); |
| 1121 | + const standard = await converter.convert(internal); |
1122 | 1122 | const expectedDefinitions = {
|
1123 | 1123 | Double: RELAXED_EJSON_DEFINITIONS.Double
|
1124 | 1124 | };
|
@@ -1209,8 +1209,8 @@ describe('internalSchemaToStandard', async function() {
|
1209 | 1209 | }
|
1210 | 1210 | ]
|
1211 | 1211 | };
|
1212 |
| - const convertor = new InternalToStandardConvertor(); |
1213 |
| - const standard = await convertor.convert(internal); |
| 1212 | + const converter = new InternalToStandardConverter(); |
| 1213 | + const standard = await converter.convert(internal); |
1214 | 1214 | ajv.validateSchema(standard);
|
1215 | 1215 | assert.deepStrictEqual(standard, {
|
1216 | 1216 | $schema: 'https://json-schema.org/draft/2020-12/schema',
|
@@ -1358,8 +1358,8 @@ describe('internalSchemaToStandard', async function() {
|
1358 | 1358 | }
|
1359 | 1359 | ]
|
1360 | 1360 | };
|
1361 |
| - const convertor = new InternalToStandardConvertor(); |
1362 |
| - const standard = await convertor.convert(internal); |
| 1361 | + const converter = new InternalToStandardConverter(); |
| 1362 | + const standard = await converter.convert(internal); |
1363 | 1363 | ajv.validateSchema(standard);
|
1364 | 1364 | assert.deepStrictEqual(standard, {
|
1365 | 1365 | $schema: 'https://json-schema.org/draft/2020-12/schema',
|
@@ -1456,8 +1456,8 @@ describe('internalSchemaToStandard', async function() {
|
1456 | 1456 | }
|
1457 | 1457 | ]
|
1458 | 1458 | };
|
1459 |
| - const convertor = new InternalToStandardConvertor(); |
1460 |
| - const standard = await convertor.convert(internal); |
| 1459 | + const converter = new InternalToStandardConverter(); |
| 1460 | + const standard = await converter.convert(internal); |
1461 | 1461 | ajv.validateSchema(standard);
|
1462 | 1462 | assert.deepStrictEqual(standard, {
|
1463 | 1463 | $schema: 'https://json-schema.org/draft/2020-12/schema',
|
@@ -1538,8 +1538,8 @@ describe('internalSchemaToStandard', async function() {
|
1538 | 1538 | }
|
1539 | 1539 | ]
|
1540 | 1540 | };
|
1541 |
| - const convertor = new InternalToStandardConvertor(); |
1542 |
| - const standard = await convertor.convert(internal); |
| 1541 | + const converter = new InternalToStandardConverter(); |
| 1542 | + const standard = await converter.convert(internal); |
1543 | 1543 | ajv.validateSchema(standard);
|
1544 | 1544 | assert.deepStrictEqual(standard, {
|
1545 | 1545 | $schema: 'https://json-schema.org/draft/2020-12/schema',
|
@@ -1658,8 +1658,8 @@ describe('internalSchemaToStandard', async function() {
|
1658 | 1658 | }
|
1659 | 1659 | ]
|
1660 | 1660 | };
|
1661 |
| - const convertor = new InternalToStandardConvertor(); |
1662 |
| - const standard = await convertor.convert(internal); |
| 1661 | + const converter = new InternalToStandardConverter(); |
| 1662 | + const standard = await converter.convert(internal); |
1663 | 1663 | ajv.validateSchema(standard);
|
1664 | 1664 | assert.deepStrictEqual(standard, {
|
1665 | 1665 | $schema: 'https://json-schema.org/draft/2020-12/schema',
|
@@ -1739,8 +1739,8 @@ describe('internalSchemaToStandard', async function() {
|
1739 | 1739 | }
|
1740 | 1740 | ]
|
1741 | 1741 | };
|
1742 |
| - const convertor = new InternalToStandardConvertor(); |
1743 |
| - const standard = await convertor.convert(internal); |
| 1742 | + const converter = new InternalToStandardConverter(); |
| 1743 | + const standard = await converter.convert(internal); |
1744 | 1744 | ajv.validateSchema(standard);
|
1745 | 1745 | const expectedDefinitions = {
|
1746 | 1746 | ObjectId: RELAXED_EJSON_DEFINITIONS.ObjectId
|
@@ -1868,8 +1868,8 @@ describe('internalSchemaToStandard', async function() {
|
1868 | 1868 | ]
|
1869 | 1869 | };
|
1870 | 1870 | const abortController = new AbortController();
|
1871 |
| - const convertor = new InternalToStandardConvertor(); |
1872 |
| - const promise = convertor.convert(internal, { signal: abortController.signal }); |
| 1871 | + const converter = new InternalToStandardConverter(); |
| 1872 | + const promise = converter.convert(internal, { signal: abortController.signal }); |
1873 | 1873 | abortController.abort(new Error('Too long, didn\'t wait.'));
|
1874 | 1874 | await assert.rejects(promise, {
|
1875 | 1875 | name: 'Error',
|
|
0 commit comments