8000 Add types by TaylorBeeston · Pull Request #14 · syntax-tree/hastscript · GitHub
[go: up one dir, main page]

Skip to content
8000

Add types #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 13, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add additional type test cases
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
  • Loading branch information
TaylorBeeston and ChristianMurphy authored Jul 11, 2020
commit 4311b4f76de33ea61ba68632b7fbca2c0e9ca7f5
12 changes: 9 additions & 3 deletions types/hastscript-tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import h = require('hastscript')

h()
h('.bar', {class: 'bar'})
h('.foo', {class: 'bar'}, h('.baz'))
h() // $ExpectType Element
h('.bar', {class: 'bar'}) // $ExpectType Element
h('.bar', 'child text') // $ExpectType Element
h('.bar', ['child text']) // $ExpectType Element
h('.foo', {class: 'bar'}, h('.baz')) // $ExpectType Element
h('.foo', {class: 'bar'}, [h('.baz')]) // $ExpectType Element
h('.bar',{class: 'bar'} , 'child text') // $ExpectType Element
h('.bar',{class: 'bar'}, ['child text']) // $ExpectType Element
h(false) // $ExpectError
0