forked from ember-decorators/ember-decorators
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Migrate from moduleFor* syntax
- Loading branch information
1 parent
9f6af93
commit c7d95b8
Showing
13 changed files
with
378 additions
and
372 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
26 changes: 13 additions & 13 deletions
26
...s/-ember-decorators/tests/unit/babel/class-decorators-legacy-and-class-properties-test.js
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,21 +1,21 @@ | ||
import { module, test } from 'qunit'; | ||
|
||
module('Babel | decorators (legacy) and class properties together '); | ||
module('Babel | decorators (legacy) and class properties together ', function() { | ||
// This test more or less only checks, if the `@decorator` syntax can be used. | ||
|
||
// This test more or less only checks, if the `@decorator` syntax can be used. | ||
test('decorators inside class and class field work.', function(assert) { | ||
function decorator(value) { | ||
assert.strictEqual(value, 123); | ||
return function() {}; | ||
} | ||
|
||
test('decorators inside class and class field work.', function(assert) { | ||
function decorator(value) { | ||
assert.strictEqual(value, 123); | ||
return function() {}; | ||
} | ||
class Foo { | ||
@decorator(123) | ||
bar = 'baz' | ||
|
||
class Foo { | ||
@decorator(123) | ||
bar = 'baz' | ||
} | ||
|
||
} | ||
|
||
new Foo(); | ||
new Foo(); | ||
}); | ||
}); | ||
|
22 changes: 11 additions & 11 deletions
22
packages/-ember-decorators/tests/unit/babel/class-decorators-legacy-test.js
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,17 +1,17 @@ | ||
import { module, test } from 'qunit'; | ||
|
||
module('Babel | decorators (legacy)'); | ||
module('Babel | decorators (legacy)', function() { | ||
// This test more or less only checks, if the `@decorator` syntax can be used. | ||
|
||
// This test more or less only checks, if the `@decorator` syntax can be used. | ||
test('it works', function(assert) { | ||
function decorator(value) { | ||
assert.strictEqual(value, 123); | ||
return function() {}; | ||
} | ||
|
||
test('it works', function(assert) { | ||
function decorator(value) { | ||
assert.strictEqual(value, 123); | ||
return function() {}; | ||
} | ||
@decorator(123) | ||
class Foo {} | ||
|
||
@decorator(123) | ||
class Foo {} | ||
|
||
new Foo(); | ||
new Foo(); | ||
}); | ||
}); |
64 changes: 32 additions & 32 deletions
64
packages/-ember-decorators/tests/unit/babel/class-properties-test.js
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,38 +1,38 @@ | ||
import { module, test } from 'qunit'; | ||
|
||
module('Babel | class properties'); | ||
module('Babel | class properties', function() { | ||
test('it works', function(assert) { | ||
// https://github.com/babel/babel/tree/6.x/packages/babel-plugin-transform-class-properties | ||
class Bork { | ||
//Property initializer syntax | ||
instanceProperty = 'bork'; | ||
boundFunction = () => { | ||
return this.instanceProperty; | ||
}; | ||
|
||
test('it works', function(assert) { | ||
// https://github.com/babel/babel/tree/6.x/packages/babel-plugin-transform-class-properties | ||
class Bork { | ||
//Property initializer syntax | ||
instanceProperty = 'bork'; | ||
boundFunction = () => { | ||
return this.instanceProperty; | ||
}; | ||
//Static class properties | ||
static staticProperty = 'babelIsCool'; | ||
static staticFunction = function() { | ||
return Bork.staticProperty; | ||
}; | ||
} | ||
|
||
//Static class properties | ||
static staticProperty = 'babelIsCool'; | ||
static staticFunction = function() { | ||
return Bork.staticProperty; | ||
}; | ||
} | ||
const myBork = new Bork(); | ||
|
||
const myBork = new Bork(); | ||
|
||
assert.strictEqual( | ||
myBork.__proto__.boundFunction, | ||
undefined, | ||
'Property initializers are not on the prototype.' | ||
); | ||
assert.strictEqual( | ||
myBork.boundFunction.call(undefined), | ||
'bork', | ||
'Bound functions are bound to the class instance.' | ||
); | ||
assert.strictEqual( | ||
Bork.staticFunction(), | ||
'babelIsCool', | ||
'Static function exists on the class.' | ||
); | ||
assert.strictEqual( | ||
myBork.__proto__.boundFunction, | ||
undefined, | ||
'Property initializers are not on the prototype.' | ||
); | ||
assert.strictEqual( | ||
myBork.boundFunction.call(undefined), | ||
'bork', | ||
'Bound functions are bound to the class instance.' | ||
); | ||
assert.strictEqual( | ||
Bork.staticFunction(), | ||
'babelIsCool', | ||
'Static function exists on the class.' | ||
); | ||
}); | ||
}); |
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
Oops, something went wrong.