Преглед на файлове

Renames tests, simplifies tsconfigs

main
Steve Ruiz преди 3 години
родител
ревизия
6aa58c7966
променени са 51 файла, в които са добавени 43 реда и са изтрити 63 реда
  1. 1
    1
      packages/core/src/components/binding/binding.test.tsx
  2. 1
    1
      packages/core/src/components/bounds/bounds.test.tsx
  3. 1
    1
      packages/core/src/components/brush/brush.test.tsx
  4. 1
    1
      packages/core/src/components/canvas/canvas.test.tsx
  5. 1
    1
      packages/core/src/components/defs/defs.test.tsx
  6. 1
    1
      packages/core/src/components/error-fallback/error-fallback.test.tsx
  7. 1
    1
      packages/core/src/components/handles/handles.test.tsx
  8. 1
    1
      packages/core/src/components/page/page.test.tsx
  9. 1
    2
      packages/core/src/components/renderer/renderer.test.tsx
  10. 1
    1
      packages/core/src/components/shape-indicator/shape-indicator.test.tsx
  11. 1
    1
      packages/core/src/components/shape/shape.test.tsx
  12. 0
    0
      packages/core/src/test/box.spec.tsx
  13. 0
    0
      packages/core/src/test/box.tsx
  14. 0
    0
      packages/core/src/test/context-wrapper.tsx
  15. 0
    0
      packages/core/src/test/index.ts
  16. 0
    0
      packages/core/src/test/mockDocument.ts
  17. 0
    0
      packages/core/src/test/mockUtils.tsx
  18. 0
    0
      packages/core/src/test/renderWithContext.tsx
  19. 0
    0
      packages/core/src/test/renderWithSvg.tsx
  20. 3
    13
      packages/core/tsconfig.build.json
  21. 1
    1
      packages/tldraw/src/components/context-menu/context-menu.test.tsx
  22. 1
    1
      packages/tldraw/src/components/style-panel/style-panel.test.tsx
  23. 1
    1
      packages/tldraw/src/components/tools-panel/tools-panel.test.tsx
  24. 1
    1
      packages/tldraw/src/state/command/align/align.command.spec.ts
  25. 1
    1
      packages/tldraw/src/state/command/create/create.command.spec.ts
  26. 1
    1
      packages/tldraw/src/state/command/delete/delete.command.spec.ts
  27. 1
    1
      packages/tldraw/src/state/command/distribute/distribute.command.spec.ts
  28. 1
    1
      packages/tldraw/src/state/command/duplicate/duplicate.command.spec.ts
  29. 1
    1
      packages/tldraw/src/state/command/flip/flip.command.spec.ts
  30. 1
    1
      packages/tldraw/src/state/command/move/move.command.spec.ts
  31. 1
    1
      packages/tldraw/src/state/command/rotate/rotate.command.spec.ts
  32. 1
    1
      packages/tldraw/src/state/command/stretch/stretch.command.spec.ts
  33. 1
    1
      packages/tldraw/src/state/command/style/style.command.spec.ts
  34. 1
    1
      packages/tldraw/src/state/command/toggle-decoration/toggle-decoration.command.spec.ts
  35. 1
    1
      packages/tldraw/src/state/command/toggle/toggle.command.spec.ts
  36. 1
    1
      packages/tldraw/src/state/command/translate/translate.command.spec.ts
  37. 1
    1
      packages/tldraw/src/state/session/sessions/arrow/arrow.session.spec.ts
  38. 1
    1
      packages/tldraw/src/state/session/sessions/brush/brush.session.spec.ts
  39. 1
    1
      packages/tldraw/src/state/session/sessions/draw/draw.session.spec.ts
  40. 1
    1
      packages/tldraw/src/state/session/sessions/handle/handle.session.spec.ts
  41. 1
    1
      packages/tldraw/src/state/session/sessions/rotate/rotate.session.spec.ts
  42. 1
    1
      packages/tldraw/src/state/session/sessions/text/text.session.spec.ts
  43. 1
    1
      packages/tldraw/src/state/session/sessions/transform-single/transform-single.session.spec.ts
  44. 1
    1
      packages/tldraw/src/state/session/sessions/transform/transform.session.spec.ts
  45. 1
    1
      packages/tldraw/src/state/session/sessions/translate/translate.session.spec.ts
  46. 1
    1
      packages/tldraw/src/state/tlstate.spec.ts
  47. 0
    0
      packages/tldraw/src/test/index.ts
  48. 0
    0
      packages/tldraw/src/test/mock-document.tsx
  49. 0
    0
      packages/tldraw/src/test/renderWithContext.tsx
  50. 0
    0
      packages/tldraw/src/test/state-utils.tsx
  51. 3
    12
      packages/tldraw/tsconfig.build.json

+ 1
- 1
packages/core/src/components/binding/binding.test.tsx Целия файл

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

+ 1
- 1
packages/core/src/components/bounds/bounds.test.tsx Целия файл

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

+ 1
- 1
packages/core/src/components/brush/brush.test.tsx Целия файл

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

+ 1
- 1
packages/core/src/components/canvas/canvas.test.tsx Целия файл

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

+ 1
- 1
packages/core/src/components/defs/defs.test.tsx Целия файл

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

+ 1
- 1
packages/core/src/components/error-fallback/error-fallback.test.tsx Целия файл

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

+ 1
- 1
packages/core/src/components/handles/handles.test.tsx Целия файл

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

+ 1
- 1
packages/core/src/components/page/page.test.tsx Целия файл

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

+ 1
- 2
packages/core/src/components/renderer/renderer.test.tsx Целия файл

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

+ 1
- 1
packages/core/src/components/shape-indicator/shape-indicator.test.tsx Целия файл

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

+ 1
- 1
packages/core/src/components/shape/shape.test.tsx Целия файл

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

packages/core/src/test-utils/box.spec.tsx → packages/core/src/test/box.spec.tsx Целия файл


packages/core/src/test-utils/box.tsx → packages/core/src/test/box.tsx Целия файл


packages/core/src/test-utils/context-wrapper.tsx → packages/core/src/test/context-wrapper.tsx Целия файл


packages/core/src/test-utils/index.ts → packages/core/src/test/index.ts Целия файл


packages/core/src/test-utils/mockDocument.ts → packages/core/src/test/mockDocument.ts Целия файл


packages/core/src/test-utils/mockUtils.tsx → packages/core/src/test/mockUtils.tsx Целия файл


packages/core/src/test-utils/renderWithContext.tsx → packages/core/src/test/renderWithContext.tsx Целия файл


packages/core/src/test-utils/renderWithSvg.tsx → packages/core/src/test/renderWithSvg.tsx Целия файл


+ 3
- 13
packages/core/tsconfig.build.json Целия файл

@@ -1,22 +1,12 @@
1 1
 {
2
-  "extends": "../../tsconfig.base.json",
3
-  "include": ["src"],
2
+  "extends": "./tsconfig.json",
4 3
   "exclude": [
5 4
     "node_modules",
6 5
     "**/*.test.tsx",
7 6
     "**/*.test.ts",
8 7
     "**/*.spec.tsx",
9 8
     "**/*.spec.ts",
10
-    "src/test-utils",
9
+    "src/test",
11 10
     "dist"
12
-  ],
13
-  "compilerOptions": {
14
-    "declaration": true,
15
-    "rootDir": "src",
16
-    "outDir": "./dist/types",
17
-    "baseUrl": "src",
18
-    "paths": {
19
-      "+*": ["./*"]
20
-    }
21
-  }
11
+  ]
22 12
 }

+ 1
- 1
packages/tldraw/src/components/context-menu/context-menu.test.tsx Целия файл

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

+ 1
- 1
packages/tldraw/src/components/style-panel/style-panel.test.tsx Целия файл

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

+ 1
- 1
packages/tldraw/src/components/tools-panel/tools-panel.test.tsx Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/align/align.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/create/create.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/delete/delete.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/distribute/distribute.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/duplicate/duplicate.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/flip/flip.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/move/move.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/rotate/rotate.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/stretch/stretch.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/style/style.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/toggle-decoration/toggle-decoration.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/toggle/toggle.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/command/translate/translate.command.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/session/sessions/arrow/arrow.session.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/session/sessions/brush/brush.session.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/session/sessions/draw/draw.session.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/session/sessions/handle/handle.session.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/session/sessions/rotate/rotate.session.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/session/sessions/text/text.session.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/session/sessions/transform-single/transform-single.session.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/session/sessions/transform/transform.session.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/session/sessions/translate/translate.session.spec.ts Целия файл

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

+ 1
- 1
packages/tldraw/src/state/tlstate.spec.ts Целия файл

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

packages/tldraw/src/test-utils/index.ts → packages/tldraw/src/test/index.ts Целия файл


packages/tldraw/src/test-utils/mock-document.tsx → packages/tldraw/src/test/mock-document.tsx Целия файл


packages/tldraw/src/test-utils/renderWithContext.tsx → packages/tldraw/src/test/renderWithContext.tsx Целия файл


packages/tldraw/src/test-utils/state-utils.tsx → packages/tldraw/src/test/state-utils.tsx Целия файл


+ 3
- 12
packages/tldraw/tsconfig.build.json Целия файл

@@ -1,21 +1,12 @@
1 1
 {
2
-  "extends": "../../tsconfig.base.json",
3
-  "include": ["src"],
2
+  "extends": "./tsconfig.json",
4 3
   "exclude": [
5 4
     "node_modules",
6 5
     "**/*.test.tsx",
7 6
     "**/*.test.ts",
8 7
     "**/*.spec.tsx",
9 8
     "**/*.spec.ts",
10
-    "src/test-utils",
9
+    "src/test",
11 10
     "dist"
12
-  ],
13
-  "compilerOptions": {
14
-    "rootDir": "src",
15
-    "outDir": "./dist/types",
16
-    "baseUrl": "src",
17
-    "paths": {
18
-      "~*": ["./*"]
19
-    }
20
-  }
11
+  ]
21 12
 }

Loading…
Отказ
Запис