-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create new
@jest/schemas
type (#12384)
- Loading branch information
Showing
13 changed files
with
119 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/__mocks__/** | ||
**/__tests__/** | ||
src | ||
tsconfig.json | ||
tsconfig.tsbuildinfo | ||
api-extractor.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# `@jest/schemas` | ||
|
||
Experimental and currently incomplete module for JSON schemas for [Jest's](https://jestjs.io/) configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "@jest/schemas", | ||
"version": "28.0.0-alpha.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/facebook/jest.git", | ||
"directory": "packages/jest-schemas" | ||
}, | ||
"license": "MIT", | ||
"main": "./build/index.js", | ||
"types": "./build/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./build/index.d.ts", | ||
"default": "./build/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"dependencies": { | ||
"@sinclair/typebox": "^0.23.3" | ||
}, | ||
"engines": { | ||
"node": "^12.13.0 || ^14.15.0 || ^16.13.0 || >=17.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import {Static, Type} from '@sinclair/typebox'; | ||
|
||
const RawSnapshotFormat = Type.Partial( | ||
Type.Object({ | ||
callToJSON: Type.Readonly(Type.Boolean()), | ||
escapeRegex: Type.Readonly(Type.Boolean()), | ||
escapeString: Type.Readonly(Type.Boolean()), | ||
highlight: Type.Readonly(Type.Boolean()), | ||
indent: Type.Readonly(Type.Number({minimum: 0})), | ||
maxDepth: Type.Readonly(Type.Number({minimum: 0})), | ||
min: Type.Readonly(Type.Boolean()), | ||
printBasicPrototype: Type.Readonly(Type.Boolean()), | ||
printFunctionName: Type.Readonly(Type.Boolean()), | ||
theme: Type.Readonly( | ||
Type.Partial( | ||
Type.Object({ | ||
comment: Type.Readonly(Type.String()), | ||
content: Type.Readonly(Type.String()), | ||
prop: Type.Readonly(Type.String()), | ||
tag: Type.Readonly(Type.String()), | ||
value: Type.Readonly(Type.String()), | ||
}), | ||
), | ||
), | ||
}), | ||
); | ||
|
||
export const SnapshotFormat = Type.Strict(RawSnapshotFormat); | ||
export type SnapshotFormat = Static<typeof RawSnapshotFormat>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "build" | ||
}, | ||
"include": ["./src/**/*"], | ||
"exclude": ["./**/__mocks__/**/*", "./**/__tests__/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
}, | ||
"author": "James Kyle <[email protected]>", | ||
"dependencies": { | ||
"@jest/schemas": "28.0.0-alpha.0", | ||
"ansi-regex": "^5.0.1", | ||
"ansi-styles": "^5.0.0", | ||
"react-is": "^17.0.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2753,6 +2753,14 @@ __metadata: | |
languageName: unknown | ||
linkType: soft | ||
|
||
"@jest/[email protected], @jest/schemas@workspace:packages/jest-schemas": | ||
version: 0.0.0-use.local | ||
resolution: "@jest/schemas@workspace:packages/jest-schemas" | ||
dependencies: | ||
"@sinclair/typebox": ^0.23.3 | ||
languageName: unknown | ||
linkType: soft | ||
|
||
"@jest/source-map@^28.0.0-alpha.0, @jest/source-map@workspace:packages/jest-source-map": | ||
version: 0.0.0-use.local | ||
resolution: "@jest/source-map@workspace:packages/jest-source-map" | ||
|
@@ -2847,6 +2855,7 @@ __metadata: | |
version: 0.0.0-use.local | ||
resolution: "@jest/types@workspace:packages/jest-types" | ||
dependencies: | ||
"@jest/schemas": 28.0.0-alpha.0 | ||
"@tsd/typescript": ~4.5.5 | ||
"@types/istanbul-lib-coverage": ^2.0.0 | ||
"@types/istanbul-reports": ^3.0.0 | ||
|
@@ -4359,6 +4368,13 @@ __metadata: | |
languageName: node | ||
linkType: hard | ||
|
||
"@sinclair/typebox@npm:^0.23.3": | ||
version: 0.23.3 | ||
resolution: "@sinclair/typebox@npm:0.23.3" | ||
checksum: c8d961c8af1b701e67641770376010634730076f0412dda34b01f1d6f54d98916414335b51929285ade43ab85bb14a372bbc287575ce4b1e0179d8af808ec4d7 | ||
languageName: node | ||
linkType: hard | ||
|
||
"@sindresorhus/is@npm:^0.14.0": | ||
version: 0.14.0 | ||
resolution: "@sindresorhus/is@npm:0.14.0" | ||
|
@@ -17802,6 +17818,7 @@ __metadata: | |
version: 0.0.0-use.local | ||
resolution: "pretty-format@workspace:packages/pretty-format" | ||
dependencies: | ||
"@jest/schemas": 28.0.0-alpha.0 | ||
"@types/react": "*" | ||
"@types/react-is": ^17.0.0 | ||
"@types/react-test-renderer": "*" | ||
|