Skip to content

Commit

Permalink
chore: Update test fixtures with fallible TS syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Apr 2, 2022
1 parent fcfbdb4 commit 2e00a6e
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 28 deletions.
10 changes: 9 additions & 1 deletion test/fixtures/ts/0/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
var test = {
var test: {
data: {
trueKey: boolean,
falseKey: boolean,
subKey: {
subProp: number
}
}
} = {
data: {
trueKey: true,
falseKey: false,
Expand Down
10 changes: 9 additions & 1 deletion test/fixtures/ts/1/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
var test = {
var test: {
data: {
trueKey: boolean,
falseKey: boolean,
subKey: {
subProp: number
}
}
} = {
data: {
trueKey: true,
falseKey: false,
Expand Down
10 changes: 7 additions & 3 deletions test/fixtures/ts/2/test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
var trueKey: boolean = true;
var falseKey: boolean = false;
var subProp: number = 1;

var test = {
data: {
trueKey: true,
falseKey: false,
trueKey: trueKey,
falseKey: falseKey,
subKey: {
subProp: 1
subProp: subProp
}
}
};
Expand Down
10 changes: 7 additions & 3 deletions test/fixtures/ts/3/test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
var trueKey: boolean = true;
var falseKey: boolean = false;
var subProp: number = 1;

var test = {
data: {
trueKey: true,
falseKey: false,
trueKey: trueKey,
falseKey: falseKey,
subKey: {
subProp: 1
subProp: subProp
}
}
};
Expand Down
14 changes: 12 additions & 2 deletions test/fixtures/ts/4/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
var test = {
var test: {
data: {
trueKey: boolean,
falseKey: boolean,
subKey: {
subProp: number
}
}
} = {
data: {
trueKey: true,
falseKey: false,
Expand All @@ -8,7 +16,9 @@ var test = {
}
};

var main = {
var main: {
default: typeof test
} = {
default: test
};

Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/ts/5/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const React = {

// Test harmony arrow functions.
const Component = () => {
var trueKey = true
var falseKey = false
var trueKey: boolean = true
var falseKey: boolean = false
var subKey = { subProp: 1 }

// Test harmony object short notation.
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/ts/5/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Component from "./component"

var test = { ...Component }
var test: typeof Component = { ...Component }

export default test
4 changes: 2 additions & 2 deletions test/fixtures/ts/6/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ function add(x: number, y: number): number {

export default {
data: {
trueKey: true,
falseKey: false,
trueKey: true as boolean,
falseKey: false as boolean,
subKey: {
subProp: add(0.5, 0.5),
},
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/tsx/0/test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const React = {
createElement (Component: () => any) {
createElement(Component: () => any) {
return Component()
}
}

// Test harmony arrow functions.
const Component = () => {
var trueKey = true
var falseKey = false
var trueKey: boolean = true
var falseKey: boolean = false
var subKey = { subProp: 1 }

// Test harmony object short notation.
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/tsx/1/test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const React = {
createElement (Component: () => any) {
createElement(Component: () => any) {
return Component()
}
}

// Test harmony arrow functions.
const Component = () => {
var trueKey = true
var falseKey = false
var trueKey: boolean = true
var falseKey: boolean = false
var subKey = { subProp: 1 }

// Test harmony object short notation.
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/tsx/2/test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const React = {
createElement (Component: () => any) {
createElement(Component: () => any) {
return Component()
}
}

// Test harmony arrow functions.
const Component = () => {
var trueKey = true
var falseKey = false
var trueKey: boolean = true
var falseKey: boolean = false
var subKey = { subProp: 1 }

// Test harmony object short notation.
Expand Down
10 changes: 9 additions & 1 deletion test/fixtures/tsx/3/data.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
var test = {
var test: {
data: {
trueKey: boolean,
falseKey: boolean,
subKey: {
subProp: number
}
}
} = {
data: {
trueKey: true,
falseKey: false,
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/tsx/3/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const React = {

// Test harmony arrow functions.
const Component = () => {
var trueKey = true
var falseKey = false
var trueKey: boolean = true
var falseKey: boolean = false
var subKey = { subProp: 1 }

// Test harmony object short notation.
Expand Down
8 changes: 7 additions & 1 deletion test/fixtures/tsx/4/data.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
export const data = {
export const data: {
trueKey: boolean,
falseKey: boolean,
subKey: {
subProp: number
}
} = {
trueKey: true,
falseKey: false,
subKey: {
Expand Down

0 comments on commit 2e00a6e

Please sign in to comment.