Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Updated test templates #33

Merged
merged 1 commit into from
Jun 26, 2017
Merged

Updated test templates #33

merged 1 commit into from
Jun 26, 2017

Conversation

c-vetter
Copy link
Contributor

Makes the default tests run with success result instead of error.

Also, while I was at it, I removed the mocking due to the now-closed jest/react-dom issue

Before

yarn test

yarn test v0.24.6
$ grommet check
[grommet:check]: Running Javascript linting...
[grommet:check]: Running SCSS linting...
[grommet:check]: Running Tests...
 FAIL  __tests__\components\NavSidebar-test.js
  ● Test suite failed to run

    TypeError: (0 , _reactRouter.createMemoryHistory) is not a function

      at Object.<anonymous> (__tests__\components\NavSidebar-test.js:18:949)
      at process._tickCallback (internal\process\next_tick.js:109:7)


=============================== Coverage summary ===============================
Statements   : 0% ( 0/570 )
Branches     : 0% ( 0/392 )
Functions    : 0% ( 0/171 )
Lines        : 0% ( 0/243 )
================================================================================
Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        4.699s
Ran all test suites.
[grommet:check]: failed
Tests Failed
error Command failed with exit code 1.

After

yarn test

yarn test v0.24.6
$ grommet check
[grommet:check]: Running Javascript linting...
[grommet:check]: Running SCSS linting...
[grommet:check]: Running Tests...
 PASS  __tests__\components\NavSidebar-test.js
  √ NavSidebar renders (9ms)


=============================== Coverage summary ===============================
Statements   : 6.52% ( 36/552 )
Branches     : 1.19% ( 4/336 )
Functions    : 1.8% ( 3/167 )
Lines        : 11.04% ( 35/317 )
================================================================================
Snapshot Summary
 › 1 snapshot written in 1 test suite.

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   1 added, 1 total
Time:        4.31s
Ran all test suites.
[grommet:check]: success
✨ 6.63 s
Done in 9.17s.

Steps to Reproduce

  1. grommet new test-app, accept defaults
  2. cd test-app
  3. yarn test

Environment

  • Grommet version: 1.4.0
  • Operating System and version (desktop or mobile): Windows 7 Ultimate (desktop)
  • yarn version: 0.24.6
  • node version: 6.10.3
  • React version: 15.5.4
  • React-Router version: 4.1.1

@alansouzati alansouzati merged commit fb30112 into grommet:master Jun 26, 2017
@alansouzati
Copy link
Contributor

thanks for your contribution

@alansouzati alansouzati self-assigned this Jun 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invariant Violation: ReactCompositeComponent: injectEnvironment() can only be called once.
3 participants