Skip to content

Commit 08d4ab1

Browse files
committed
test: create a new test file for better structure
1 parent 8464543 commit 08d4ab1

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { describe, test } from "vitest";
2+
import { readFile } from "../../../test/fs.utils.js";
3+
import path from "path";
4+
import { fromJson } from "./index.js";
5+
import { strict as assert } from "node:assert";
6+
7+
describe("JSON formatter", () => {
8+
describe("fromJsonStruct", () => {
9+
const schemaWithDuplicatedNodeLabels = readFile(
10+
path.resolve(__dirname, "./test-schemas/duplicated-nodeLabel-ids.json")
11+
);
12+
test("Identifies duplicated node labels adn throws an error", () => {
13+
assert.throws(() => fromJson(schemaWithDuplicatedNodeLabels));
14+
});
15+
});
16+
});

packages/graph-schema-utils/test/validation/error-validation.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@ const JSON_SCHEMA = JSON.stringify(
1212

1313
// Validate type errors == schemas we expect NOT to pass
1414
describe("Validate type errors", () => {
15-
describe("Identifies duplicated node labels", () => {
16-
test("Duplicated node labels", () => {
17-
const duplicatedNodeLabels = readFile(
18-
path.resolve(__dirname, "./test-schemas/duplicated-node-labels.json")
19-
);
20-
assert.throws(
21-
() => validateSchema(JSON_SCHEMA, duplicatedNodeLabels),
22-
SchemaValidationError
23-
);
24-
});
25-
});
2615
describe("Identifies unsupported types", () => {
2716
test("Node object types", () => {
2817
const unsupportedNodeSpecs = readFile(

0 commit comments

Comments
 (0)