mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
[ember] tests for access modifier keywords. Fixes https://github.com/typed-ember/ember-cli-typescript/issues/226
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import Ember from 'ember';
|
||||
import { assertType } from './lib/assert';
|
||||
|
||||
class Foo extends Ember.Object {
|
||||
hello() { return 'world'; }
|
||||
protected bar() { return 'bar'; }
|
||||
private baz() { return 'baz'; }
|
||||
}
|
||||
const f = new Foo();
|
||||
assertType<string>(f.hello());
|
||||
assertType<string>(f.bar()); // $ExpectError
|
||||
assertType<string>(f.baz()); // $ExpectError
|
||||
|
||||
class Foo2 extends Ember.Object.extend({
|
||||
bar: ''
|
||||
}) {
|
||||
hello() { return 'world'; }
|
||||
protected bar() { return 'bar'; } // $ExpectError
|
||||
private baz() { return 'baz'; }
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
"index.d.ts",
|
||||
"test/lib/assert.ts",
|
||||
"test/application.ts",
|
||||
"test/access-modifier.ts",
|
||||
"test/application-instance.ts",
|
||||
"test/engine-instance.ts",
|
||||
"test/ember-tests.ts",
|
||||
|
||||
Reference in New Issue
Block a user