1#!/bin/sh
2#
3# Copyright 2016 Google Inc. All rights reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17pushd "$(dirname $0)" >/dev/null
18
19npm install @types/flatbuffers
20
21../flatc --ts --no-fb-import --gen-mutable -o ts -I include_test monster_test.fbs
22../flatc -b -I include_test monster_test.fbs unicode_test.json
23tsc --strict --noUnusedParameters --noUnusedLocals --noImplicitReturns --strictNullChecks ts/monster_test_generated.ts
24node JavaScriptTest ./ts/monster_test_generated
25
26../flatc --ts --js --no-fb-import -o ts union_vector/union_vector.fbs
27
28# test JS version first, then transpile and rerun for TS
29node JavaScriptUnionVectorTest ./ts/union_vector_generated
30tsc --strict --noUnusedParameters --noUnusedLocals --noImplicitReturns --strictNullChecks ts/union_vector_generated.ts
31node JavaScriptUnionVectorTest ./ts/union_vector_generated
32
33npm uninstall @types/flatbuffers
34