File tree Expand file tree Collapse file tree 7 files changed +153
-0
lines changed Expand file tree Collapse file tree 7 files changed +153
-0
lines changed Original file line number Diff line number Diff line change 66* .htm text diff =html eol =lf
77* .html text diff =html eol =lf
88* .js text eol =lf
9+ * .ts text eol =lf
910* .mjs text eol =lf
1011* .cjs text eol =lf
1112* .json text eol =lf
Original file line number Diff line number Diff line change 1+
2+ # typescript generated
3+ * .js
4+ * .js.map
5+
Original file line number Diff line number Diff line change 1+
2+ import JsonURL from "@jsonurl/jsonurl" ;
3+ import { readFileSync } from "fs" ;
4+ const pkg = JSON . parse ( String ( readFileSync ( "package.json" ) ) ) ;
5+ const expected = "(hello:world)" ;
6+
7+ function assert ( actual ) {
8+ if ( actual !== expected ) {
9+ console . log (
10+ pkg . description ,
11+ ": expected '" + expected + "' but received '" + actual + "'"
12+ ) ;
13+
14+ process . exit ( 1 ) ;
15+ }
16+ }
17+
18+ assert ( JsonURL . stringify ( JsonURL . parse ( expected ) ) ) ;
19+
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " @jsonurl/itest-es6-ts" ,
3+ "version" : " 0.0.0" ,
4+ "private" : true ,
5+ "description" : " JSON->URL node ES6+Typescript integration test" ,
6+ "main" : " main.js" ,
7+ "type" : " module" ,
8+ "scripts" : {
9+ "build" : " npx tsc" ,
10+ "test" : " node ./"
11+ },
12+ "author" : " David MacCormack" ,
13+ "license" : " MIT" ,
14+ "repository" : {
15+ "type" : " git" ,
16+ "url" : " git+https://github.com/jsonurl/jsonurl-js.git"
17+ },
18+ "bugs" : {
19+ "url" : " https://github.com/jsonurl/jsonurl-js/issues"
20+ },
21+ "homepage" : " https://www.jsonurl.org/" ,
22+ "dependencies" : {
23+ "@jsonurl/jsonurl" : " file:../.." ,
24+ "typescript" : " ^4.8.4"
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "target" : " es6" ,
4+ "moduleResolution" : " node" ,
5+ "sourceMap" : true
6+ }
7+ }
Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ itest es6-babel || test_es6babel_status=1
6868test_jsdom_status=0
6969itest jsdom || test_jsdom_status=1
7070
71+ test_es6ts_status=0
72+ itest es6-ts || test_es6ts_status=1
73+
7174#
7275# This test depends on the version of node.
7376# node < 11 : no support for native ES6 modules
@@ -93,11 +96,13 @@ itest_status cjs $test_cjs_status
9396itest_status es6-babel $test_es6babel_status
9497itest_status es6-native $test_es6native_status
9598itest_status jsdom $test_jsdom_status
99+ itest_status es6-ts $test_es6ts_status
96100
97101itest_exit cjs $test_cjs_exit
98102itest_exit es6-babel $test_es6babel_exit
99103itest_exit es6-native $test_es6native_exit
100104itest_exit jsdom $test_jsdom_exit
105+ itest_exit es6-ts $test_es6ts_exit
101106
102107exit 0
103108
You can’t perform that action at this time.
0 commit comments