Renames tests, simplifies tsconfigs

This commit is contained in:
Steve Ruiz 2021-08-14 17:17:29 +01:00
parent b8f410b752
commit 6aa58c7966
51 changed files with 43 additions and 63 deletions

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { renderWithSvg } from '+test-utils'
import { renderWithSvg } from '+test'
import { Binding } from './binding'
jest.spyOn(console, 'error').mockImplementation(() => void null)

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { renderWithSvg } from '+test-utils'
import { renderWithSvg } from '+test'
import { Bounds } from './bounds'
describe('bounds', () => {

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { renderWithSvg } from '+test-utils'
import { renderWithSvg } from '+test'
import { Brush } from './brush'
describe('brush', () => {

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { mockDocument, renderWithContext } from '+test-utils'
import { mockDocument, renderWithContext } from '+test'
import { Canvas } from './canvas'
describe('page', () => {

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { renderWithSvg } from '+test-utils'
import { renderWithSvg } from '+test'
import { Defs } from './defs'
describe('defs', () => {

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { renderWithContext } from '+test-utils'
import { renderWithContext } from '+test'
import { ErrorFallback } from './error-fallback'
describe('error fallback', () => {

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { mockUtils, renderWithContext } from '+test-utils'
import { mockUtils, renderWithContext } from '+test'
import { Handles } from './handles'
describe('handles', () => {

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { mockDocument, renderWithContext } from '+test-utils'
import { mockDocument, renderWithContext } from '+test'
import { Page } from './page'
describe('page', () => {

View file

@ -1,6 +1,5 @@
import * as React from 'react'
import { mockDocument } from '+test-utils/mockDocument'
import { mockUtils } from '+test-utils/mockUtils'
import { mockDocument, mockUtils } from '+test'
import { render } from '@testing-library/react'
import { Renderer } from './renderer'

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { mockUtils, renderWithSvg } from '+test-utils'
import { mockUtils, renderWithSvg } from '+test'
import { ShapeIndicator } from './shape-indicator'
describe('shape indicator', () => {

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { mockUtils, renderWithSvg } from '+test-utils'
import { mockUtils, renderWithSvg } from '+test'
import { Shape } from './shape'
describe('handles', () => {

View file

@ -1,22 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"extends": "./tsconfig.json",
"exclude": [
"node_modules",
"**/*.test.tsx",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.spec.ts",
"src/test-utils",
"src/test",
"dist"
],
"compilerOptions": {
"declaration": true,
"rootDir": "src",
"outDir": "./dist/types",
"baseUrl": "src",
"paths": {
"+*": ["./*"]
}
}
]
}

View file

@ -1,6 +1,6 @@
import * as React from 'react'
import { ContextMenu } from './context-menu'
import { renderWithContext } from '~test-utils'
import { renderWithContext } from '~test'
describe('context menu', () => {
test('mounts component', () => {

View file

@ -1,5 +1,5 @@
import * as React from 'react'
import { renderWithContext } from '~test-utils'
import { renderWithContext } from '~test'
import { StylePanel } from './style-panel'
describe('style panel', () => {

View file

@ -1,6 +1,6 @@
import * as React from 'react'
import { ToolsPanel } from './tools-panel'
import { renderWithContext } from '~test-utils'
import { renderWithContext } from '~test'
describe('tools panel', () => {
test('mounts component', () => {

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { AlignType } from '~types'
describe('Align command', () => {

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
describe('Create command', () => {
const tlstate = new TLDrawState()

View file

@ -1,6 +1,6 @@
import { TLDR } from '~state/tldr'
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import type { TLDrawShape } from '~types'
describe('Delete command', () => {

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { DistributeType } from '~types'
describe('Distribute command', () => {

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
describe('Duplicate command', () => {
const tlstate = new TLDrawState()

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import type { RectangleShape } from '~types'
describe('Stretch command', () => {

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { Utils } from '@tldraw/core'
import type { Data } from '~types'

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
describe('Rotate command', () => {
const tlstate = new TLDrawState()

View file

@ -1,6 +1,6 @@
import { StretchType, RectangleShape } from '~types'
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
describe('Stretch command', () => {
const tlstate = new TLDrawState()

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { SizeStyle } from '~types'
describe('Style command', () => {

View file

@ -1,6 +1,6 @@
import { TLDR } from '~state/tldr'
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { ArrowShape, Decoration, TLDrawShape } from '~types'
describe('Handle command', () => {

View file

@ -1,6 +1,6 @@
import type { RectangleShape } from '~types'
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
describe('Toggle command', () => {
const tlstate = new TLDrawState()

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
describe('Translate command', () => {
const tlstate = new TLDrawState()

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { TLDR } from '~state/tldr'
import type { ArrowShape, TLDrawShape } from '~types'

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
describe('Brush session', () => {
const tlstate = new TLDrawState()

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { ColorStyle, DashStyle, SizeStyle, TLDrawShapeType } from '~types'
describe('Transform session', () => {

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { TLDR } from '~state/tldr'
import type { TLDrawShape } from '~types'

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
describe('Brush session', () => {
const tlstate = new TLDrawState()

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { TLDR } from '~state/tldr'
import { TextShape, TLDrawShape, TLDrawShapeType } from '~types'

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { TLBoundsCorner } from '@tldraw/core'
describe('Transform single session', () => {

View file

@ -1,5 +1,5 @@
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import { TLBoundsCorner, Utils } from '@tldraw/core'
import { TLDR } from '~state/tldr'

View file

@ -1,6 +1,6 @@
import { TLDR } from '~state/tldr'
import { TLDrawState } from '~state'
import { mockDocument } from '~test-utils'
import { mockDocument } from '~test'
import type { TLDrawShape } from '~types'
describe('Brush session', () => {

View file

@ -1,5 +1,5 @@
import { TLDrawState } from './tlstate'
import { mockDocument, TLStateUtils } from '~test-utils'
import { mockDocument, TLStateUtils } from '~test'
describe('TLDrawState', () => {
const tlstate = new TLDrawState()

View file

@ -1,21 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"extends": "./tsconfig.json",
"exclude": [
"node_modules",
"**/*.test.tsx",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.spec.ts",
"src/test-utils",
"src/test",
"dist"
],
"compilerOptions": {
"rootDir": "src",
"outDir": "./dist/types",
"baseUrl": "src",
"paths": {
"~*": ["./*"]
}
}
]
}