Skip to content

Commit

Permalink
Add test of alias skipped when inherited by parent
Browse files Browse the repository at this point in the history
  • Loading branch information
aedart committed Feb 27, 2024
1 parent 41a0b1c commit 462663b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/browser/packages/support/concerns/use-edge-cases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,30 @@ describe('@aedart/support/concerns', () => {
expect(result)
.toBe('done');
});

it('does not alias property key inherited by parent', () => {

class A {
driver() {
return 'xyz';
}
}

class ConcernsDriver extends AbstractConcern {
driver() {
return 'special';
}
}

@use(ConcernsDriver) // driver() is NOT aliased - method inherited from class A!
class B extends A {}

// --------------------------------------------------------------------------- //

const instance = new B();

expect(instance.driver())
.toBe('xyz');
});
});
});

0 comments on commit 462663b

Please sign in to comment.