Skip to content

Commit

Permalink
Convert binding
Browse files Browse the repository at this point in the history
  • Loading branch information
Katryn McIntosh committed Oct 15, 2021
1 parent 094e48f commit 6a9a4fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion addon/-private/binding.js → addon/-private/binding.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export default class Binding {
constructor(path) {
public path: Array<string>;

public constructor(path: string) {
this.path = path.split('.');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import HelperSpec from 'ember-exclaim/-private/helper-spec';
module('Unit | helper-spec');

test('discovering bindings', function (assert) {
let config = {
const config = {
foo: new Binding('foo'),
bar: [new Binding('bar[1]'), new Binding('bar[2]')],
baz: {
Expand All @@ -14,10 +14,10 @@ test('discovering bindings', function (assert) {
},
};

let spec = new HelperSpec(() => {}, config);
const spec = new HelperSpec(() => {}, config);

assert.deepEqual(
spec.bindings.map((binding) => binding.path.join('')).sort(),
spec.bindings.map((binding: Binding) => binding.path.join('')).sort(),
['a', 'b', 'bar[1]', 'bar[2]', 'foo', 'value']
);
});

0 comments on commit 6a9a4fe

Please sign in to comment.