Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
Removed module augmentation 'bleed' tests from d3-selection shape tes…
Browse files Browse the repository at this point in the history
…ts. The compiler behavior is as intended, given the import of d3-transition elsewhere in the repo tests. If all imports to d3-transition are removed in all modules, the tests fail as expected. Fixes #4.
  • Loading branch information
tomwanzek committed Jul 4, 2016
1 parent 2757478 commit 15cc5cd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ respective generator with data. I.e. it can be global object, undefined or anyth

See [issue 2 BaseType definition for selection/transition elements](https://github.com/tomwanzek/d3-v4-definitelytyped/issues/2).

See [issue 3 module augmentation bleed](https://github.com/tomwanzek/d3-v4-definitelytyped/issues/3), if using **d3-selection** and **d3-transition** in the same compilation context, where a module imports _only_ **d3-selection**.

**Note**: Utilizes `this`-typing (criticality: _high_)

`this`-typing is used for context-binding to DOM element.
Expand Down
17 changes: 0 additions & 17 deletions tests/d3-selection/d3-selection-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -925,20 +925,3 @@ predefinedNamespaces['dummy'] = 'http://www.w3.org/2020/dummynamespace';
xWindow = d3Selection.window(xElement);
xWindow = d3Selection.window(xDoc);
xWindow = d3Selection.window(xWindow);

// ---------------------------------------------------------------------------------------
// TEST OF GITHUB ISSUE #4 (https://github.com/tomwanzek/d3-v4-definitelytyped/issues/4)
// ---------------------------------------------------------------------------------------

// fails as expected, as transition(...) method and Transition<...> interface are not defined on d3-selection
// let transition : d3Selection.Transition<any,any,any,any> = d3Selection.transition('test');

// UNEXPECTEDLY does NOT FAIL as module augmentation of Selection<...> interface in d3-transition bleeds into this test module,
// although d3-transition has not been imported

let ghostTransition = body.transition('test'); // SHOULD FAIL, method transition(...) SHOULD NOT BE AVAILABLE on body Selection<...> without d3-transition import

ghostTransition.duration(500); // SHOULD FAIL, ghostTransition has properties of Transition<...>

body.interrupt('test'); // SHOULD FAIL, method interrupt(...) SHOULD NOT BE AVAILABLE on body Selection<...> without d3-transition import

0 comments on commit 15cc5cd

Please sign in to comment.