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

Fix/improve end to end tests #326

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patrick91
Copy link
Contributor

@patrick91 patrick91 commented May 17, 2018

This PR will provide better e2e tests (so to actually check if TypeScript files are being loaded) and should also fix the failure with #270

@patrick91
Copy link
Contributor Author

@DorianGrey the e2e tests are passing, even if I emptied the webpack.config.prod.js file. It seems to me that is actually using the standard create react app to run the tests or am I missing something? :)

@DorianGrey
Copy link
Collaborator

I already mentioned in the other PR that the kitchensink task is using a different template for some of the tests - see https://github.com/wmonk/create-react-app-typescript/blob/master/tasks/e2e-kitchensink.sh#L103

The template is located here: https://github.com/wmonk/create-react-app-typescript/tree/master/packages/react-scripts/fixtures/kitchensink

@patrick91
Copy link
Contributor Author

Yup, it is using a different template for the application files, but it seems to be that it is still using the react-scripts package for the configuration, it seems also that it is getting that package from npm, since it is not published on verdaccio, as you can see from the logs:

 http --> 200, req: 'GET https://registry.npmjs.org/react-scripts' (streaming)
 http --> 200, req: 'GET https://registry.npmjs.org/react-scripts', bytes: 0/208787
 http <-- 200, user: undefined(127.0.0.1), req: 'GET /react-scripts', bytes: 0/16969
 http <-- 200, user: undefined(127.0.0.1), req: 'GET /babel-preset-react-app', bytes: 0/7

and here's the list of packages published on verdaccio:

screen shot 2018-05-20 at 00 26 57

if I check the package.json of the created app we can also see that it is mentioning react-scripts and not react-scripts-ts:

/v/f/g/_/T/t/test-kitchensink (py3.6) cat package.json
{
  "name": "test-kitchensink",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.3.2",
    "react-dom": "^16.3.2",
    "react-scripts": "1.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}%

@DorianGrey
Copy link
Collaborator

Yup, it is using a different template for the application files, but it seems to be that it is still using the react-scripts package for the configuration

Yes - in the other PR, you already pointed out that the kitchensink test is not using react-scripts-ts, since this script version is not used in the command used for creating the app, so that command as to adopted to do so.
However, regularly, this would cause both the build configuration and project template to be used, but the --internal-testing-template flag enforces the special kitchensink template, while retaining the build config and scripts.
I.e.: Both the command used for creating the project for the kitchensink test and the special template used for it have to be modified resp. adopted.

@patrick91
Copy link
Contributor Author

So, this fix the test we should force the kitchensink to use react-scripts-ts and update the template as well, right?
I might work on it this weekend

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.

None yet

2 participants