Renames tests, simplifies tsconfigs
This commit is contained in:
parent
b8f410b752
commit
6aa58c7966
51 changed files with 43 additions and 63 deletions
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { renderWithSvg } from '+test-utils'
|
import { renderWithSvg } from '+test'
|
||||||
import { Binding } from './binding'
|
import { Binding } from './binding'
|
||||||
|
|
||||||
jest.spyOn(console, 'error').mockImplementation(() => void null)
|
jest.spyOn(console, 'error').mockImplementation(() => void null)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { renderWithSvg } from '+test-utils'
|
import { renderWithSvg } from '+test'
|
||||||
import { Bounds } from './bounds'
|
import { Bounds } from './bounds'
|
||||||
|
|
||||||
describe('bounds', () => {
|
describe('bounds', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { renderWithSvg } from '+test-utils'
|
import { renderWithSvg } from '+test'
|
||||||
import { Brush } from './brush'
|
import { Brush } from './brush'
|
||||||
|
|
||||||
describe('brush', () => {
|
describe('brush', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { mockDocument, renderWithContext } from '+test-utils'
|
import { mockDocument, renderWithContext } from '+test'
|
||||||
import { Canvas } from './canvas'
|
import { Canvas } from './canvas'
|
||||||
|
|
||||||
describe('page', () => {
|
describe('page', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { renderWithSvg } from '+test-utils'
|
import { renderWithSvg } from '+test'
|
||||||
import { Defs } from './defs'
|
import { Defs } from './defs'
|
||||||
|
|
||||||
describe('defs', () => {
|
describe('defs', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { renderWithContext } from '+test-utils'
|
import { renderWithContext } from '+test'
|
||||||
import { ErrorFallback } from './error-fallback'
|
import { ErrorFallback } from './error-fallback'
|
||||||
|
|
||||||
describe('error fallback', () => {
|
describe('error fallback', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { mockUtils, renderWithContext } from '+test-utils'
|
import { mockUtils, renderWithContext } from '+test'
|
||||||
import { Handles } from './handles'
|
import { Handles } from './handles'
|
||||||
|
|
||||||
describe('handles', () => {
|
describe('handles', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { mockDocument, renderWithContext } from '+test-utils'
|
import { mockDocument, renderWithContext } from '+test'
|
||||||
import { Page } from './page'
|
import { Page } from './page'
|
||||||
|
|
||||||
describe('page', () => {
|
describe('page', () => {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { mockDocument } from '+test-utils/mockDocument'
|
import { mockDocument, mockUtils } from '+test'
|
||||||
import { mockUtils } from '+test-utils/mockUtils'
|
|
||||||
import { render } from '@testing-library/react'
|
import { render } from '@testing-library/react'
|
||||||
import { Renderer } from './renderer'
|
import { Renderer } from './renderer'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { mockUtils, renderWithSvg } from '+test-utils'
|
import { mockUtils, renderWithSvg } from '+test'
|
||||||
import { ShapeIndicator } from './shape-indicator'
|
import { ShapeIndicator } from './shape-indicator'
|
||||||
|
|
||||||
describe('shape indicator', () => {
|
describe('shape indicator', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { mockUtils, renderWithSvg } from '+test-utils'
|
import { mockUtils, renderWithSvg } from '+test'
|
||||||
import { Shape } from './shape'
|
import { Shape } from './shape'
|
||||||
|
|
||||||
describe('handles', () => {
|
describe('handles', () => {
|
||||||
|
|
|
@ -1,22 +1,12 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": ["src"],
|
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"**/*.test.tsx",
|
"**/*.test.tsx",
|
||||||
"**/*.test.ts",
|
"**/*.test.ts",
|
||||||
"**/*.spec.tsx",
|
"**/*.spec.tsx",
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
"src/test-utils",
|
"src/test",
|
||||||
"dist"
|
"dist"
|
||||||
],
|
]
|
||||||
"compilerOptions": {
|
|
||||||
"declaration": true,
|
|
||||||
"rootDir": "src",
|
|
||||||
"outDir": "./dist/types",
|
|
||||||
"baseUrl": "src",
|
|
||||||
"paths": {
|
|
||||||
"+*": ["./*"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { ContextMenu } from './context-menu'
|
import { ContextMenu } from './context-menu'
|
||||||
import { renderWithContext } from '~test-utils'
|
import { renderWithContext } from '~test'
|
||||||
|
|
||||||
describe('context menu', () => {
|
describe('context menu', () => {
|
||||||
test('mounts component', () => {
|
test('mounts component', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { renderWithContext } from '~test-utils'
|
import { renderWithContext } from '~test'
|
||||||
import { StylePanel } from './style-panel'
|
import { StylePanel } from './style-panel'
|
||||||
|
|
||||||
describe('style panel', () => {
|
describe('style panel', () => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { ToolsPanel } from './tools-panel'
|
import { ToolsPanel } from './tools-panel'
|
||||||
import { renderWithContext } from '~test-utils'
|
import { renderWithContext } from '~test'
|
||||||
|
|
||||||
describe('tools panel', () => {
|
describe('tools panel', () => {
|
||||||
test('mounts component', () => {
|
test('mounts component', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { AlignType } from '~types'
|
import { AlignType } from '~types'
|
||||||
|
|
||||||
describe('Align command', () => {
|
describe('Align command', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
|
|
||||||
describe('Create command', () => {
|
describe('Create command', () => {
|
||||||
const tlstate = new TLDrawState()
|
const tlstate = new TLDrawState()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { TLDR } from '~state/tldr'
|
import { TLDR } from '~state/tldr'
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import type { TLDrawShape } from '~types'
|
import type { TLDrawShape } from '~types'
|
||||||
|
|
||||||
describe('Delete command', () => {
|
describe('Delete command', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { DistributeType } from '~types'
|
import { DistributeType } from '~types'
|
||||||
|
|
||||||
describe('Distribute command', () => {
|
describe('Distribute command', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
|
|
||||||
describe('Duplicate command', () => {
|
describe('Duplicate command', () => {
|
||||||
const tlstate = new TLDrawState()
|
const tlstate = new TLDrawState()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import type { RectangleShape } from '~types'
|
import type { RectangleShape } from '~types'
|
||||||
|
|
||||||
describe('Stretch command', () => {
|
describe('Stretch command', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { Utils } from '@tldraw/core'
|
import { Utils } from '@tldraw/core'
|
||||||
import type { Data } from '~types'
|
import type { Data } from '~types'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
|
|
||||||
describe('Rotate command', () => {
|
describe('Rotate command', () => {
|
||||||
const tlstate = new TLDrawState()
|
const tlstate = new TLDrawState()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { StretchType, RectangleShape } from '~types'
|
import { StretchType, RectangleShape } from '~types'
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
|
|
||||||
describe('Stretch command', () => {
|
describe('Stretch command', () => {
|
||||||
const tlstate = new TLDrawState()
|
const tlstate = new TLDrawState()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { SizeStyle } from '~types'
|
import { SizeStyle } from '~types'
|
||||||
|
|
||||||
describe('Style command', () => {
|
describe('Style command', () => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { TLDR } from '~state/tldr'
|
import { TLDR } from '~state/tldr'
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { ArrowShape, Decoration, TLDrawShape } from '~types'
|
import { ArrowShape, Decoration, TLDrawShape } from '~types'
|
||||||
|
|
||||||
describe('Handle command', () => {
|
describe('Handle command', () => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { RectangleShape } from '~types'
|
import type { RectangleShape } from '~types'
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
|
|
||||||
describe('Toggle command', () => {
|
describe('Toggle command', () => {
|
||||||
const tlstate = new TLDrawState()
|
const tlstate = new TLDrawState()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
|
|
||||||
describe('Translate command', () => {
|
describe('Translate command', () => {
|
||||||
const tlstate = new TLDrawState()
|
const tlstate = new TLDrawState()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { TLDR } from '~state/tldr'
|
import { TLDR } from '~state/tldr'
|
||||||
import type { ArrowShape, TLDrawShape } from '~types'
|
import type { ArrowShape, TLDrawShape } from '~types'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
|
|
||||||
describe('Brush session', () => {
|
describe('Brush session', () => {
|
||||||
const tlstate = new TLDrawState()
|
const tlstate = new TLDrawState()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { ColorStyle, DashStyle, SizeStyle, TLDrawShapeType } from '~types'
|
import { ColorStyle, DashStyle, SizeStyle, TLDrawShapeType } from '~types'
|
||||||
|
|
||||||
describe('Transform session', () => {
|
describe('Transform session', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { TLDR } from '~state/tldr'
|
import { TLDR } from '~state/tldr'
|
||||||
import type { TLDrawShape } from '~types'
|
import type { TLDrawShape } from '~types'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
|
|
||||||
describe('Brush session', () => {
|
describe('Brush session', () => {
|
||||||
const tlstate = new TLDrawState()
|
const tlstate = new TLDrawState()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { TLDR } from '~state/tldr'
|
import { TLDR } from '~state/tldr'
|
||||||
import { TextShape, TLDrawShape, TLDrawShapeType } from '~types'
|
import { TextShape, TLDrawShape, TLDrawShapeType } from '~types'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { TLBoundsCorner } from '@tldraw/core'
|
import { TLBoundsCorner } from '@tldraw/core'
|
||||||
|
|
||||||
describe('Transform single session', () => {
|
describe('Transform single session', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import { TLBoundsCorner, Utils } from '@tldraw/core'
|
import { TLBoundsCorner, Utils } from '@tldraw/core'
|
||||||
import { TLDR } from '~state/tldr'
|
import { TLDR } from '~state/tldr'
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { TLDR } from '~state/tldr'
|
import { TLDR } from '~state/tldr'
|
||||||
import { TLDrawState } from '~state'
|
import { TLDrawState } from '~state'
|
||||||
import { mockDocument } from '~test-utils'
|
import { mockDocument } from '~test'
|
||||||
import type { TLDrawShape } from '~types'
|
import type { TLDrawShape } from '~types'
|
||||||
|
|
||||||
describe('Brush session', () => {
|
describe('Brush session', () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { TLDrawState } from './tlstate'
|
import { TLDrawState } from './tlstate'
|
||||||
import { mockDocument, TLStateUtils } from '~test-utils'
|
import { mockDocument, TLStateUtils } from '~test'
|
||||||
|
|
||||||
describe('TLDrawState', () => {
|
describe('TLDrawState', () => {
|
||||||
const tlstate = new TLDrawState()
|
const tlstate = new TLDrawState()
|
||||||
|
|
|
@ -1,21 +1,12 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": ["src"],
|
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"**/*.test.tsx",
|
"**/*.test.tsx",
|
||||||
"**/*.test.ts",
|
"**/*.test.ts",
|
||||||
"**/*.spec.tsx",
|
"**/*.spec.tsx",
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
"src/test-utils",
|
"src/test",
|
||||||
"dist"
|
"dist"
|
||||||
],
|
]
|
||||||
"compilerOptions": {
|
|
||||||
"rootDir": "src",
|
|
||||||
"outDir": "./dist/types",
|
|
||||||
"baseUrl": "src",
|
|
||||||
"paths": {
|
|
||||||
"~*": ["./*"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue