Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

Jest preset #160

Closed
egoist opened this issue Apr 30, 2017 · 12 comments
Closed

Jest preset #160

egoist opened this issue Apr 30, 2017 · 12 comments
Labels

Comments

@egoist
Copy link
Owner

egoist commented Apr 30, 2017

Basically this preset allows us to run jest with poi test --presets jest.

Anyone interested in this could look into the preset API, this preset might look like:

module.exports = options => {
  return poi => {
    poi.mode('test', () => {
      require('jest').run(['--config', JSON.stringify(jestConfig)])
    })
  }
}
@egoist
Copy link
Owner Author

egoist commented May 11, 2017

Have to release this before v8.0.0

@egoist
Copy link
Owner Author

egoist commented Oct 17, 2017

If you're working on a Vue project, test-vue-app will do the job for you, and the fact is that it works with other frameworks (most, like React, just add a .babelrc for React JSX) too.

@skiano
Copy link
Contributor

skiano commented Oct 28, 2017

@egoist If/when this preset exists and I am using vue, would you recommend sticking with test-vue-app or migrating to the poi preset?

@egoist
Copy link
Owner Author

egoist commented Oct 30, 2017

@skiano test-vue-app would be easier cuz

  1. you don't have to configure anything to use it
  2. you don't need to use it with a specific build tool.

Maybe we can make test-vue-app become the poi in unit testing world 😄

@skiano
Copy link
Contributor

skiano commented Oct 30, 2017

@egoist that sounds great! I will just use that.

I love the idea of keeping the testing separate. If you want that to be like poi for testing , do you think it should be migrated to a different name? perhaps poi-test ?

@egoist
Copy link
Owner Author

egoist commented Oct 30, 2017

@skiano that's for sure 😂

@egoist
Copy link
Owner Author

egoist commented Nov 9, 2017

@skiano It's now renamed to tyu

2017-11-10 12 02 55

@skiano
Copy link
Contributor

skiano commented Nov 9, 2017

@egoist thanks for the heads up!

@darcnite3000
Copy link

@egoist would adding a babelrc file with the babel-preset-poi make jest work out of the box with poi?

@darcnite3000
Copy link

just to note that I recently tested adding the babel-preset and followed jest's babel 7 setup notes and it worked

.babelrc

{
  "presets": [
    "babel-preset-poi"
  ]
}

add jest

yarn add --dev jest babel-jest 'babel-core@^7.0.0-0' @babel/core regenerator-runtime

@egoist
Copy link
Owner Author

egoist commented Jun 8, 2018

Yeah the official Jest doc has documented this: https://facebook.github.io/jest/docs/en/getting-started.html#using-babel

@github-actions
Copy link

github-actions bot commented May 1, 2020

This issue has been marked as Stale, it will be closed in a week if there's no furthur activity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants