Skip to content

Conversation

stephan-nordnes-eriksen
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Bugfix:

With this fix, the local imports in tests are resolved, and you can now do the following inside your tests;

import { test } from 'ava'
import { MyModule } from './myModule'
import { MyOtherModule } from '../whatever/myOtherModule'

// Use MyModule in tests
  • What is the current behavior? (You can also link to an open issue here)
    Currently, the tests are not able to import files locally, effectively limiting unit testing to only testing exposed code

The following does not work;

import { test } from 'ava'
import { MyModule } from './myModule'
import { MyOtherModule } from '../whatever/myOtherModule'

// Use MyModule in tests

Currently, the tests are not able to import files locally, effectively limiting unit testing to only testing exposed code.

With this fix, the local imports are resolved, and you can now do the following inside your tests;

```
import { test } from 'ava'
import { MyModule } from './myModule'

// Use MyModule in tests
```
@codecov
Copy link

codecov bot commented Jan 11, 2018

Codecov Report

Merging #58 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #58   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines          18     18           
=====================================
  Hits           18     18

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0445249...3f28509. Read the comment docs.

@bitjson
Copy link
Owner

bitjson commented Feb 14, 2018

Thanks for the pull request @stephan-nordnes-eriksen! Sorry to pull a conflict over it. If you're still interested, would you mind merging?

@bitjson bitjson closed this Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to execute tests for internal methods?
2 participants