mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
TS tests fixes (#4265)
* Eclipse ignore * TypeScript support * Prefixing enums * Test results * Merged JS and TS generators * Fixed AppVeyor build problems * Fixed more AppVeyor build problems * Fixed more AppVeyor build problems * Changed TS flag to options struct * Storing options by value * Removed unneeded const * Re-export support for unions * Uint support * Casting bools to numbers for mutation * TS shell tests * Reverted generates js test file to original version * Backing up js tests and properly generating test data * Not importing flatbuffers for TS test generation * Not overwriting generated js for tests * AppVeyor test fixes
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
340d1a3447
commit
808b44f87a
1
.gitignore
vendored
1
.gitignore
vendored
@@ -48,6 +48,7 @@ tests/monsterdata_java_wire.mon
|
||||
tests/monsterdata_go_wire.mon
|
||||
tests/monsterdata_javascript_wire.mon
|
||||
tests/unicode_test.mon
|
||||
tests/ts/
|
||||
CMakeLists.txt.user
|
||||
CMakeScripts/**
|
||||
CTestTestfile.cmake
|
||||
|
||||
@@ -31,7 +31,7 @@ test_script:
|
||||
- rem "---------------- JS -----------------"
|
||||
- "node --version"
|
||||
- "..\\%CONFIGURATION%\\flatc -b monster_test.fbs unicode_test.json"
|
||||
- "node JavaScriptTest"
|
||||
- "node JavaScriptTest ./monster_test_generated"
|
||||
- rem "---------------- C# -----------------"
|
||||
# Have to compile this here rather than in "build" above because AppVeyor only
|
||||
# supports building one project??
|
||||
|
||||
@@ -3,7 +3,7 @@ var assert = require('assert');
|
||||
var fs = require('fs');
|
||||
|
||||
var flatbuffers = require('../js/flatbuffers').flatbuffers;
|
||||
var MyGame = require('./monster_test_generated').MyGame;
|
||||
var MyGame = require(process.argv[2]).MyGame;
|
||||
|
||||
function main() {
|
||||
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
pushd "$(dirname $0)" >/dev/null
|
||||
../flatc -b monster_test.fbs unicode_test.json
|
||||
node JavaScriptTest
|
||||
node JavaScriptTest ./monster_test_generated
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
# limitations under the License.
|
||||
|
||||
pushd "$(dirname $0)" >/dev/null
|
||||
../flatc --ts --no-fb-import --gen-mutable monster_test.fbs
|
||||
../flatc --ts --no-fb-import --gen-mutable -o ts monster_test.fbs
|
||||
../flatc -b monster_test.fbs unicode_test.json
|
||||
npm install @types/flatbuffers
|
||||
mv monster_test_generated.js monster_test_generated.js.bak
|
||||
tsc monster_test_generated.ts
|
||||
tsc ts/monster_test_generated.ts
|
||||
npm uninstall @types/flatbuffers
|
||||
node JavaScriptTest
|
||||
mv monster_test_generated.js.bak monster_test_generated.js
|
||||
node JavaScriptTest ./ts/monster_test_generated
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
../flatc --cpp --java --csharp --go --binary --python --js --ts --php --grpc --gen-mutable --gen-object-api --no-includes monster_test.fbs monsterdata_test.json
|
||||
../flatc --cpp --java --csharp --go --binary --python --js --ts --php --gen-mutable -o namespace_test namespace_test/namespace_test1.fbs namespace_test/namespace_test2.fbs
|
||||
../flatc --cpp --java --csharp --go --binary --python --js --ts --php --grpc --gen-mutable --gen-object-api --no-includes --no-fb-import monster_test.fbs monsterdata_test.json
|
||||
../flatc --cpp --java --csharp --go --binary --python --js --ts --php --gen-mutable --no-fb-import -o namespace_test namespace_test/namespace_test1.fbs namespace_test/namespace_test2.fbs
|
||||
../flatc --cpp --gen-mutable --gen-object-api -o union_vector ./union_vector/union_vector.fbs
|
||||
../flatc -b --schema --bfbs-comments monster_test.fbs
|
||||
cd ../samples
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
import { flatbuffers } from "./flatbuffers"
|
||||
/**
|
||||
* @enum
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
import { flatbuffers } from "./flatbuffers"
|
||||
import * as NS9459827973991502386 from "./namespace_test1_generated";
|
||||
export * from "./namespace_test1_generated";
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user