Update Ember tests to treat 'string & number' and 'never' the same (#36095)

* Update tests to treat 'string & number' and 'never' the same

* Remove $ExpectType since both 'string & number' or 'never' are ok
This commit is contained in:
Anders Hejlsberg
2019-06-11 09:32:01 -07:00
committed by GitHub
parent a8ab3f0817
commit fa812c285d
5 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -76,7 +76,7 @@ const co6 = Ember.CoreObject.extend({
this.init; // $ExpectType () => void
// this includes stuff from this extend-arg
// TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291
this.foo; // $ExpectType string & number
this.foo;
// this includes stuff from earlier extend-args
this.bar; // $ExpectType number
}
@@ -110,7 +110,7 @@ const co7 = Ember.CoreObject.extend({
this.init; // $ExpectType () => void
// this includes stuff from this extend-arg
// TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291
this.foo; // $ExpectType string & number
this.foo;
// this includes stuff from earlier extend-args
this.bar; // $ExpectType number
}
@@ -156,7 +156,7 @@ const co8 = Ember.CoreObject.extend({
this.init; // $ExpectType () => void
// this includes stuff from this extend-arg
// TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291
this.foo; // $ExpectType string & number
this.foo;
// this includes stuff from earlier extend-args
this.bar; // $ExpectType number
// this does not include stuff from later extend args
+1 -1
View File
@@ -9,7 +9,7 @@ class ES6Class extends Ember.Object {
bar: string;
}
const testObject = null;
const testObject: any = null;
if (ExtendClass.detectInstance(testObject)) {
assertType<string>(testObject.foo);
+1 -1
View File
@@ -9,7 +9,7 @@ class ES6Class extends Ember.Object {
bar: string;
}
let testObject = null;
let testObject: any = null;
if (ExtendClass.detectInstance(testObject)) {
assertType<string>(testObject.foo);
+3 -3
View File
@@ -78,7 +78,7 @@ const co6 = CoreObject.extend(
this.init; // $ExpectType () => void
// this includes stuff from this extend-arg
// TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291
this.foo; // $ExpectType string & number
this.foo;
// this includes stuff from earlier extend-args
this.bar; // $ExpectType number
}
@@ -115,7 +115,7 @@ const co7 = CoreObject.extend(
this.init; // $ExpectType () => void
// this includes stuff from this extend-arg
// TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291
this.foo; // $ExpectType string & number
this.foo;
// this includes stuff from earlier extend-args
this.bar; // $ExpectType number
}
@@ -165,7 +165,7 @@ const co8 = CoreObject.extend(
this.init; // $ExpectType () => void
// this includes stuff from this extend-arg
// TODO: switch to "$ExpectType number" in TS 3.0 see: https://github.com/typed-ember/ember-cli-typescript/issues/291
this.foo; // $ExpectType string & number
this.foo;
// this includes stuff from earlier extend-args
this.bar; // $ExpectType number
// this does not include stuff from later extend args
+1 -1
View File
@@ -9,7 +9,7 @@ class ES6Class extends EmberObject {
bar: string;
}
const testObject = null;
const testObject: any = null;
if (ExtendClass.detectInstance(testObject)) {
assertType<string>(testObject.foo);