Skip to content
Merged
Show file tree
Hide file tree
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
Add additional TypeScript tests
  • Loading branch information
ianschmitz committed Nov 24, 2019
commit 3632e8ac20e95a5bb902793f9b0fe970153e9db1
4 changes: 2 additions & 2 deletions tasks/local-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function print_help {
echo "Usage: ${0} [OPTIONS]"
echo ""
echo "OPTIONS:"
echo " --node-version <version> the node version to use while testing [8]"
echo " --node-version <version> the node version to use while testing [12]"
echo " --git-branch <branch> the git branch to checkout for testing [the current one]"
echo " --test-suite <suite> which test suite to use ('simple', installs', 'kitchensink', 'kitchensink-eject', 'all') ['all']"
echo " --interactive gain a bash shell after the test run"
Expand All @@ -18,7 +18,7 @@ function print_help {

cd $(dirname $0)

node_version=8
node_version=12
current_git_branch=`git rev-parse --abbrev-ref HEAD`
git_branch=${current_git_branch}
test_suite=all
Expand Down
11 changes: 10 additions & 1 deletion test/fixtures/typescript-advanced/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ interface MyType {
baz?: { n: number };
}

function assertIsString(val: any): asserts val is string {
if (typeof val !== "string") {
throw new Error("Not a string!");
}
}

const foo: any = "bar";
assertIsString(foo);

type MyObject = Pick<MyType, 'bar' | 'baz'>;

class App extends React.Component {
static foo: MyObject = { bar: true, baz: { n: 123 } };
n = App.foo.baz!.n;
n = App.foo?.baz!.n ?? "foo";

render() {
return <div />;
Expand Down