Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed May 22, 2024
1 parent f75dbaf commit 319fcfe
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/valid-data-type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,6 @@ describe("valid-data-type", () => {
it("lowercase", assertValidSchema("lowercase", "MyType"));

it("promise-extensions", assertValidSchema("promise-extensions", "*"));

it("export-star", assertValidSchema("export-star", "*", undefined, { mainTsOnly: true }));
});
5 changes: 5 additions & 0 deletions test/valid-data/export-star/literal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type A = 1;

export type B = "string";

type C = "internal";
4 changes: 4 additions & 0 deletions test/valid-data/export-star/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "./literal";
export * from "./object";

export type External = 1;
11 changes: 11 additions & 0 deletions test/valid-data/export-star/object.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface D {
a: 1;
}

export class E {
b: 2;
}

interface F {
internal: true;
}
43 changes: 43 additions & 0 deletions test/valid-data/export-star/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"A": {
"const": 1,
"type": "number"
},
"B": {
"const": "string",
"type": "string"
},
"D": {
"additionalProperties": false,
"properties": {
"a": {
"const": 1,
"type": "number"
}
},
"required": [
"a"
],
"type": "object"
},
"E": {
"additionalProperties": false,
"properties": {
"b": {
"const": 2,
"type": "number"
}
},
"required": [
"b"
],
"type": "object"
},
"External": {
"const": 1,
"type": "number"
}
}
}

0 comments on commit 319fcfe

Please sign in to comment.