Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Add jest as a test runner #67

Merged
merged 2 commits into from
Dec 12, 2017
Merged

Conversation

KevinGrandon
Copy link
Contributor

@KevinGrandon KevinGrandon commented Dec 12, 2017

Creates a fusion-cli command, fusion test-app, which wraps and runs jest.

Exports a test() function which gets passed in a assert library for backwards compatibility.

Fixes #68

@KevinGrandon KevinGrandon force-pushed the add_jest branch 3 times, most recently from fad5d27 to 31fcf24 Compare December 12, 2017 01:23
@codecov
Copy link

codecov bot commented Dec 12, 2017

Codecov Report

Merging #67 into master will decrease coverage by 1.11%.
The diff coverage is 21.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #67      +/-   ##
==========================================
- Coverage   68.94%   67.82%   -1.12%     
==========================================
  Files          64       66       +2     
  Lines        1378     1411      +33     
  Branches      300      307       +7     
==========================================
+ Hits          950      957       +7     
- Misses        374      400      +26     
  Partials       54       54
Impacted Files Coverage Δ
build/test-app-runtime.js 12% <12%> (ø)
commands/test-app.js 50% <50%> (ø)

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 de34ba7...76c6dbd. Read the comment docs.

@@ -0,0 +1,10 @@
/* eslint-env node */
import {configure} from 'enzyme';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if people don't use enzyme in their tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary, but I think we should probably enable by default? We can add a config to turn this off though.

@@ -0,0 +1,4 @@
/* eslint-env node */
global.requestAnimationFrame = callback => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required for running react tests in node - they ask you to bring your own polyfills.


let command = require.resolve('jest-cli/bin/jest.js');
let args = [
// '--no-cache',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this should be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, though it's really useful for debugging.

const transformer = require('babel-jest').createTransformer({
presets: [
'babel-preset-flow',
'babel-preset-es2015',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the es2015 preset required given that we require Node 8+?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try getting rid of it. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this is required for modules to work. Might be able to do this with a smaller plugin, but since it's only for tests, I don't think it's too bad.

@KevinGrandon KevinGrandon changed the title Implement jest as a test runner Add jest as a test runner Dec 12, 2017
@KevinGrandon
Copy link
Contributor Author

!merge

@old-fusion-bot old-fusion-bot bot merged commit 0aab3d2 into fusionjs:master Dec 12, 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.

3 participants