From 2f0c7353eefe34c4721480377a54f3f7b64540a1 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Sat, 6 Jun 2020 23:32:39 -0700 Subject: [PATCH] Fix type errors on TS 3.6, 3.7, build on CI --- .travis.yml | 7 +++++ config/ember-try.js | 43 ++++++++++++++++++++++++++ tests/dummy/snippets/ts/yield/utils.ts | 4 ++- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d6691494b..fad92a4b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,10 +54,17 @@ jobs: - env: EMBER_TRY_SCENARIO=ember-lts-2.18 - env: EMBER_TRY_SCENARIO=ember-lts-3.4 - env: EMBER_TRY_SCENARIO=ember-lts-3.8 + - env: EMBER_TRY_SCENARIO=ember-lts-3.12 + - env: EMBER_TRY_SCENARIO=ember-lts-3.16 - env: EMBER_TRY_SCENARIO=ember-release - env: EMBER_TRY_SCENARIO=ember-beta - env: EMBER_TRY_SCENARIO=ember-canary - env: EMBER_TRY_SCENARIO=ember-default-with-jquery + - env: EMBER_TRY_SCENARIO=typescript-3.6 + before_script: sed -i 's/@ts-expect-error/@ts-ignore/g' tests/types/**/*.ts + - env: EMBER_TRY_SCENARIO=typescript-3.7 + before_script: sed -i 's/@ts-expect-error/@ts-ignore/g' tests/types/**/*.ts + - env: EMBER_TRY_SCENARIO=typescript-3.9 script: - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO diff --git a/config/ember-try.js b/config/ember-try.js index 9822b7aca..e62cd8b18 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -85,6 +85,22 @@ module.exports = async function() { } } }, + { + name: 'ember-lts-3.12', + npm: { + devDependencies: { + 'ember-source': '~3.12.0' + } + } + }, + { + name: 'ember-lts-3.16', + npm: { + devDependencies: { + 'ember-source': '~3.16.0' + } + } + }, { name: 'ember-release', npm: { @@ -131,6 +147,33 @@ module.exports = async function() { '@ember/jquery': '^0.6.1' } } + }, + { + name: 'typescript-3.6', + npm: { + devDependencies: { + 'typescript': '~3.6.0' + } + }, + command: 'tsc' + }, + { + name: 'typescript-3.7', + npm: { + devDependencies: { + 'typescript': '~3.7.0' + } + }, + command: 'tsc' + }, + { + name: 'typescript-3.9', + npm: { + devDependencies: { + 'typescript': '~3.9.0' + } + }, + command: 'tsc' } ] }; diff --git a/tests/dummy/snippets/ts/yield/utils.ts b/tests/dummy/snippets/ts/yield/utils.ts index d0490e8e1..93bcebb90 100644 --- a/tests/dummy/snippets/ts/yield/utils.ts +++ b/tests/dummy/snippets/ts/yield/utils.ts @@ -22,4 +22,6 @@ export function taskFor(task: AnyTaskFunction | AnyAsyncTaskFunction): AnyTask { return task as any; } -export type JSON = string | number | boolean | null | JSON[] | { [key: string]: JSON }; +export type JSON = string | number | boolean | null | JSONArray | JSONObject; +export interface JSONArray extends Array {} +export interface JSONObject extends Record {}