mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
enable intellisense for the main classes (#10618)
This commit is contained in:
19
test/spec/util/rebind.js
Normal file
19
test/spec/util/rebind.js
Normal file
@@ -0,0 +1,19 @@
|
||||
describe('utilRebind', () => {
|
||||
it('copies methods from source to target', () => {
|
||||
const target = { original: 123 };
|
||||
const source = new class {
|
||||
value = 456;
|
||||
method() {
|
||||
return this.value;
|
||||
}
|
||||
};
|
||||
|
||||
const copied = iD.utilRebind(target, source, 'method');
|
||||
|
||||
expect(copied).toStrictEqual({
|
||||
original: 123,
|
||||
method: expect.any(Function)
|
||||
});
|
||||
expect(copied.method()).toBe(456);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user