Skip to content

Commit

Permalink
Convert Slate tests to TypeScript (ianstormtaylor#3784)
Browse files Browse the repository at this point in the history
* changed to tsx

* slate tests

* finished making typescript tests

* linting

* linting

* reverted slate-hyperscript files to jsx and changed edlint config

* removed extra file

* Update package.json

* Update package.json

* deleted { file

* changed to tsx

* slate tests

* finished making typescript tests

* linting

* linting

* reverted slate-hyperscript files to jsx and changed edlint config

* removed extra file

* Update package.json

* Update package.json

* deleted { file

* rebase

* removed ~ files

* changed yarn
  • Loading branch information
mdmjg authored Jul 14, 2020
1 parent 97dbab1 commit 93fe251
Show file tree
Hide file tree
Showing 1,700 changed files with 17,484 additions and 20,671 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
},
"overrides": [
{
"files": "**/test/**/*.js",
"files": "**/test/**/*.{js,jsx,ts,tsx}",
"rules": {
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/** @jsx jsx */
import { jsx } from '../..'

export const run = editor => {
editor.deleteBackward()
}
export const input = (
<editor>
<block>Hello</block>
<block>
<cursor />
world!
</block>
</editor>
)
export const output = (
<editor>
<block>Hello</block>
<block>
<cursor />
world!
</block>
</editor>
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @jsx jsx */
import { jsx } from '../..'

export const run = editor => {
editor.deleteBackward()
}
export const input = (
<editor>
<block>Hello</block>
<block>
<block>
<cursor />
world!
</block>
</block>
</editor>
)
export const output = (
<editor>
<block>Hello</block>
<block>
<block>
<cursor />
world!
</block>
</block>
</editor>
)
20 changes: 0 additions & 20 deletions packages/slate-history/test/undo/delete_backward/block-text.js

This file was deleted.

17 changes: 17 additions & 0 deletions packages/slate-history/test/undo/delete_backward/block-text.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** @jsx jsx */
import { Transforms } from 'slate'
import { jsx } from '../..'

export const run = editor => {
Transforms.delete(editor)
}
export const input = (
<editor>
<block>
wo
<cursor />
rd
</block>
</editor>
)
export const output = input
23 changes: 0 additions & 23 deletions packages/slate-history/test/undo/delete_backward/custom-prop.js

This file was deleted.

20 changes: 20 additions & 0 deletions packages/slate-history/test/undo/delete_backward/custom-prop.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** @jsx jsx */
import { Transforms } from 'slate'
import { jsx } from '../..'

export const run = editor => {
Transforms.delete(editor)
}
export const input = (
<editor>
<block a>
o<anchor />
ne
</block>
<block b>
tw
<focus />o
</block>
</editor>
)
export const output = input
31 changes: 0 additions & 31 deletions packages/slate-history/test/undo/delete_backward/inline-across.js

This file was deleted.

28 changes: 28 additions & 0 deletions packages/slate-history/test/undo/delete_backward/inline-across.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @jsx jsx */
import { Transforms } from 'slate'
import { jsx } from '../..'

export const run = editor => {
Transforms.delete(editor)
}
export const input = (
<editor>
<block>
<text />
<inline a>
o<anchor />
ne
</inline>
<text />
</block>
<block>
<text />
<inline b>
tw
<focus />o
</inline>
<text />
</block>
</editor>
)
export const output = input
22 changes: 0 additions & 22 deletions packages/slate-history/test/undo/insert_break/basic.js

This file was deleted.

19 changes: 19 additions & 0 deletions packages/slate-history/test/undo/insert_break/basic.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @jsx jsx */
import { Editor } from 'slate'
import { jsx } from '../..'

export const run = editor => {
editor.insertBreak()
}
export const input = (
<editor>
<block>
<block>
on
<cursor />e
</block>
<block>two</block>
</block>
</editor>
)
export const output = input
42 changes: 0 additions & 42 deletions packages/slate-history/test/undo/insert_fragment/basic.js

This file was deleted.

37 changes: 37 additions & 0 deletions packages/slate-history/test/undo/insert_fragment/basic.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/** @jsx jsx */
import { jsx } from '../..'

const fragment = (
<block type="d">
<block>A</block>
<block type="c">
<block type="d">
<block>B</block>
<block>
<block type="d">
<block>C</block>
</block>
</block>
</block>
<block type="d">
<block>D</block>
</block>
</block>
</block>
)
export const run = editor => {
editor.insertFragment(fragment)
}
export const input = (
<editor>
<block type="d">
<block>
<text>
<cursor />
</text>
</block>
</block>
</editor>
)
export const output = input
export const skip = true
Loading

0 comments on commit 93fe251

Please sign in to comment.