Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(ts): Added a TS compilation check #589

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 15 additions & 1 deletion package-lock.json

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"cordova-windows"
],
"scripts": {
"test": "npm run lint",
"lint": "eslint ."
"test": "npm run lint && npm run test:types",
"lint": "eslint .",
"test:types": "tsc --project ./types/tests/tsconfig.json"
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
Expand All @@ -48,6 +49,7 @@
}
},
"devDependencies": {
"@cordova/eslint-config": "^5.0.0"
"@cordova/eslint-config": "^5.0.0",
"typescript": "^5.1.6"
}
}
24 changes: 24 additions & 0 deletions types/tests/index.ts
breautek marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

// Intentionally empty file to serve has an entry point to the TSC compiler.
// The tsconfig file also pulls in /index.d.ts which is the main thing being
// tested.

// Additional code could be added to conduct further type testing.
11 changes: 11 additions & 0 deletions types/tests/tsconfig.json
breautek marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"noEmit": true
},
"files": [
"../index.d.ts"
],
"include": [
"./*.ts"
]
}
Loading