Skip to content

Commit

Permalink
test: move schema test to unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 committed Aug 9, 2024
1 parent 66389b0 commit 106cd2e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 48 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/schema.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions apps/cli/src/linter/specs/schema-json.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import zodToJsonSchema from 'zod-to-json-schema';

import { ConfigurationSchema } from '../schema';

describe('Schema JSON Check', () => {
it('should check schema.json is consistent with git HEAD', () => {
const currentSchema = zodToJsonSchema(ConfigurationSchema);
const file = readFileSync(join('./schema.json'));
expect(JSON.parse(file.toString())).toEqual(currentSchema);
});
});
2 changes: 1 addition & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -696,4 +696,4 @@
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
}

0 comments on commit 106cd2e

Please # to comment.