-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add decorator and class field acceptance tests
- Loading branch information
Chris Garrett
committed
Mar 16, 2019
1 parent
4e19548
commit 766f277
Showing
7 changed files
with
88 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
ecmaVersion: 2017, | ||
sourceType: 'module' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,36 @@ | ||
import Controller from '@ember/controller'; | ||
import { computed } from "@ember/object"; | ||
import { A } from "@ember/array"; | ||
import { computed } from '@ember/object'; | ||
import { A } from '@ember/array'; | ||
import Animal from 'dummy/utils/class-animal'; | ||
|
||
export default Controller.extend({ | ||
init() { | ||
this._super(...arguments); | ||
this.animal = new Animal('dog'); | ||
}, | ||
|
||
animalName: computed({ | ||
get() { | ||
const animal = new Animal('dog'); | ||
return animal.name; | ||
} | ||
return this.animal.name; | ||
}, | ||
}), | ||
|
||
staticAnimalType: computed({ | ||
get() { | ||
return Animal.type; | ||
}, | ||
}), | ||
|
||
// Just a very roundabout way of using some ES6 features | ||
value: ((test = 'Test') => `${test} ${'Value'}`)(), | ||
|
||
// Test a generator (needs the regenerator runtime) and some ES6 constructs (requires the corejs polyfill) | ||
values: A(Array.from({ *[Symbol.iterator]() { yield 'one'; yield 'two'; } })) | ||
values: A( | ||
Array.from({ | ||
*[Symbol.iterator]() { | ||
yield 'one'; | ||
yield 'two'; | ||
}, | ||
}) | ||
), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters