Skip to content

Commit a0bd59b

Browse files
committed
test: register global schema in before hook
1 parent 4f475f5 commit a0bd59b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tests/utils/yaml.combine.tests.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ import fs from "fs";
55
import yaml from "js-yaml";
66
import lodash from "lodash";
77

8+
import { JSONSchemasInterface } from "../../src/JSONSchemasInterface";
89
import { combineType, esseType } from "../../src/utils/yaml";
910
import { YAML_COMBINE_FILE } from "../enums";
11+
import { MOCK_GLOBAL_SCHEMA } from "../fixtures/mock_esse_schema";
1012

1113
const combineSchema = yaml.DEFAULT_SCHEMA.extend([combineType, esseType]);
1214

1315
describe("YAML tag: !combine", () => {
1416
let yamlFixture;
1517
let parsed;
1618

17-
// eslint-disable-next-line func-names
18-
before(function () {
19-
this.timeout(5000);
19+
before(() => {
20+
JSONSchemasInterface.registerGlobalSchema(MOCK_GLOBAL_SCHEMA);
2021
yamlFixture = fs.readFileSync(YAML_COMBINE_FILE, "utf8");
2122
parsed = yaml.load(yamlFixture, { schema: combineSchema });
2223
});

tests/utils/yaml.esse.tests.ts

+3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { expect } from "chai";
33
import fs from "fs";
44
import yaml from "js-yaml";
55

6+
import { JSONSchemasInterface } from "../../src/JSONSchemasInterface";
67
import { esseType } from "../../src/utils/yaml";
78
import { YAML_ESSE_FILE } from "../enums";
9+
import { MOCK_GLOBAL_SCHEMA } from "../fixtures/mock_esse_schema";
810

911
const yamlSchema = yaml.DEFAULT_SCHEMA.extend([esseType]);
1012

@@ -13,6 +15,7 @@ describe("YAML tag: !esse", () => {
1315
let parsed;
1416

1517
before(() => {
18+
JSONSchemasInterface.registerGlobalSchema(MOCK_GLOBAL_SCHEMA);
1619
yamlFixture = fs.readFileSync(YAML_ESSE_FILE, "utf8");
1720
parsed = yaml.load(yamlFixture, { schema: yamlSchema });
1821
});

0 commit comments

Comments
 (0)