Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.htm text diff=html eol=lf
*.html text diff=html eol=lf
*.js text eol=lf
*.ts text eol=lf
*.mjs text eol=lf
*.cjs text eol=lf
*.json text eol=lf
Expand Down
5 changes: 5 additions & 0 deletions itest/es6-ts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# typescript generated
*.js
*.js.map

19 changes: 19 additions & 0 deletions itest/es6-ts/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

import JsonURL from "@jsonurl/jsonurl";
import { readFileSync } from "fs";
const pkg = JSON.parse(String(readFileSync("package.json")));
const expected = "(hello:world)";

function assert(actual) {
if (actual !== expected) {
console.log(
pkg.description,
": expected '" + expected + "' but received '" + actual + "'"
);

process.exit(1);
}
}

assert(JsonURL.stringify(JsonURL.parse(expected)));

90 changes: 90 additions & 0 deletions itest/es6-ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions itest/es6-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@jsonurl/itest-es6-ts",
"version": "0.0.0",
"private": true,
"description": "JSON->URL node ES6+Typescript integration test",
"main": "main.js",
"type": "module",
"scripts": {
"build": "npx tsc",
"test": "node ./"
},
"author": "David MacCormack",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/jsonurl/jsonurl-js.git"
},
"bugs": {
"url": "https://github.com/jsonurl/jsonurl-js/issues"
},
"homepage": "https://www.jsonurl.org/",
"dependencies": {
"@jsonurl/jsonurl": "file:../..",
"typescript": "^4.8.4"
}
}
7 changes: 7 additions & 0 deletions itest/es6-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"target": "es6",
"moduleResolution": "node",
"sourceMap": true
}
}
5 changes: 5 additions & 0 deletions itest/itest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ itest es6-babel || test_es6babel_status=1
test_jsdom_status=0
itest jsdom || test_jsdom_status=1

test_es6ts_status=0
itest es6-ts || test_es6ts_status=1

#
# This test depends on the version of node.
# node < 11 : no support for native ES6 modules
Expand All @@ -93,11 +96,13 @@ itest_status cjs $test_cjs_status
itest_status es6-babel $test_es6babel_status
itest_status es6-native $test_es6native_status
itest_status jsdom $test_jsdom_status
itest_status es6-ts $test_es6ts_status

itest_exit cjs $test_cjs_exit
itest_exit es6-babel $test_es6babel_exit
itest_exit es6-native $test_es6native_exit
itest_exit jsdom $test_jsdom_exit
itest_exit es6-ts $test_es6ts_exit

exit 0