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

Project Testers and feedback needed! #49

Closed
kentcdodds opened this issue Feb 2, 2018 · 15 comments
Closed

Project Testers and feedback needed! #49

kentcdodds opened this issue Feb 2, 2018 · 15 comments

Comments

@kentcdodds
Copy link
Owner

Hey folks 👋

I have a few needs for this project!

  1. Test to make sure it works on various machines/environments (should take just a few minutes) 🏎💨
  2. Feedback on the content of the workshop (a bit more of a commitment) 🐢💨

Project testing

I could use a hand making sure this project can run on anyone's computer and is intuitive to set up. If there is a problem with your environment, this project should hopefully provide enough context for you to fix the problem on your own.

I especially need testers on Windows and Linux machines because I work exclusively on a Mac 🍎.

Instructions:

I'm not going to explain how to set up the project in this issue. Please just follow the instructions on the README. If something's unclear or you experience issues, please file a new issue about it❗️ If everything goes well for you, please add an emoji reaction to this comment of 👍. Thanks so much!

Feedback

After you've set up the project, if you'd like to go through some of the tests, please do so. Note that the testing is not yet split up for exercises/quizzes/workshoppy things yet. It's all just tests like a normal app would be. In the next few weeks I'll be splitting things up to make them conducive to the workshop experience.

Instructions:

Because this workshop is instructor led, there are no instructions on how all the scripts work. So just pull up the root package.json and look at the available scripts. Hopefully that should be enough to get you going. The most important scripts though are:

  • npm run test to run the client/server unit/integration tests in watch mode
  • npm run test:e2e to run the cypress tests in development mode

If anything is unclear 🤔 to you about how things work or why I made certain decisions, or if you disagree 🙅 with some of my decisions, please feel free to file an issue and make suggestions or ask questions. I make no promises I'll follow your suggestions, or even take the time to justify my position (I'm very limited on my time). I'll try though :)

Thanks! 🙏

Thank you so much for taking the time to help me out with this! I'll be giving part of this workshop at Assert(js) later this month. Then I'll be giving it in March in San Francisco (details forthcoming), and in April for Frontend Masters! 🕶

@kentcdodds
Copy link
Owner Author

I'd like to extend a special invitation to my friends from the Cypress team: @brian-mann, @jennifer-shehane, @bahmutov, and @chrisbreiding. This repo has been completely rewritten since you saw it last. As this is going to be used to teach people how to use Cypress, I thought you'd appreciate a chance to look and provide some feedback on how I'm doing things :) Feel free to open a new issue (or PR!) if you have comments/suggest/feedback. Thanks!

@Dubes
Copy link

Dubes commented Feb 2, 2018

verified on win 10 home with node: v9.1.0 and npm 5.6.0
I am also testing it on the Windows linux subsytem (bash on ubuntu on windows), but it keeps getting stuck at different points of installing, will try to replicate it and raise a bug if it still keeps failing

@bahmutov
Copy link

bahmutov commented Feb 2, 2018

Thanks for letting us know about these issues - so sorry about the state of things on windows platform - that OS is a can of worms ;)

@edm00se
Copy link
Contributor

edm00se commented Feb 2, 2018

I think I see what @Dubes is experiencing. In the cypress error section, it says a missing system dependency should be installed first. Specifically xvfb; the exiting error code given by test:e2e was 255.

After running sudo apt-get install xvfb then re-running npm run setup --silent appears to run correctly, but is currently getting stuck in test:e2e with cypress claiming a missing dep, libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory. I'll look into it further later tonight.

@kentcdodds
Copy link
Owner Author

Thanks for digging @edm00se!

@edm00se
Copy link
Contributor

edm00se commented Feb 2, 2018

I think I got past that all; it's mostly Cypress complaining about a lack of GUI it can use. Using Windows System Linux — Ubuntu (Win10's "BASH"), I had to install some dependencies; some of which didn't surface without running npm run validate. This all seems to be due to the fact that WSL is a headless environment, with no GUI out of the box.

Here's a command to install the required dependencies.

sudo apt-get install xvfb libgtk2.0-0 libxtst6 libxss1 libgconf-2-4
Output of `npm run setup --silent` after installing dependencies.

λ testing-workshop → λ git master → npm run setup --silent
🎉  Congrats! Your system is setup properly
You should be good to install and run things.
📦  Installing dependencies via npm install
🔑  starting install in /path/to/testing-workshop
up to date in 27.366s
🎉  finished installing dependencies in "/path/to/testing-workshop"
🔑  starting install in /path/to/testing-workshop/shared
up to date in 0.351s
🎉  finished installing dependencies in "/path/to/testing-workshop/shared"
🔑  starting install in /path/to/testing-workshop/server
added 1 package in 20.941s
🎉  finished installing dependencies in "/path/to/testing-workshop/server"
🔑  starting install in /path/to/testing-workshop/client
updated 27 packages in 43.629s
🎉  finished installing dependencies in "/path/to/testing-workshop/client"
👍  all dependencies installed
[test:e2e] module.js:540
[test:e2e]     throw err;
[test:e2e]     ^
[test:e2e]
[test:e2e] Error: Cannot find module 'has-ansi'
[test:e2e]     at Function.Module._resolveFilename (module.js:538:15)
[test:e2e]     at Function.Module._load (module.js:468:25)
[test:e2e]     at Module.require (module.js:587:17)
[test:e2e]     at require (internal/module.js:11:18)
[test:e2e]     at Object.<anonymous> (/path/to/testing-workshop/node_modules/concurrently/node_modules/chalk/index.js:5:15)
[test:e2e]     at Module._compile (module.js:643:30)
[test:e2e]     at Object.Module._extensions..js (module.js:654:10)
[test:e2e]     at Module.load (module.js:556:32)
[test:e2e]     at tryModuleLoad (module.js:499:12)
[test:e2e]     at Function.Module._load (module.js:491:3)
[test:e2e] npm run test:e2e:run --silent exited with code 1
[lint] npm run lint --silent exited with code 0
[test:coverage]  FAIL   server  server/__tests__/posts.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module './state_abbr' from 'index.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (../shared/node_modules/faker/lib/locales/ja/address/index.js:5:22)
[test:coverage]
[test:coverage]  PASS   server  server/src/controllers/__tests__/auth.js (14.41s)
[test:coverage]  PASS   client  client/src/__tests__/app.js (16.358s)
[test:coverage]  FAIL   client  client/src/components/__tests__/user.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module './adjective' from 'index.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (../shared/node_modules/faker/lib/locales/en/company/index.js:4:21)
[test:coverage]
[test:coverage]  PASS   client  client/src/components/__tests__/login.js (12.257s)
[test:coverage]  PASS   server  server/__tests__/auth.js
[test:coverage]  PASS   server  server/src/__tests__/db.js (9.186s)
[test:coverage]  PASS   server  server/__tests__/users.js (5.35s)
[test:coverage]
[test:coverage] Test Suites: 2 failed, 6 passed, 8 total
[test:coverage] Tests:       30 passed, 30 total
[test:coverage] Snapshots:   11 passed, 11 total
[test:coverage] Time:        37.573s
[test:coverage] Ran all test suites in 2 projects.
[test:coverage] ------------------------|----------|----------|----------|----------|----------------|
[test:coverage] File                    |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
[test:coverage] ------------------------|----------|----------|----------|----------|----------------|
[test:coverage] All files               |    73.62 |    54.87 |    56.25 |    74.27 |                |
[test:coverage]  client/src             |    57.14 |    68.75 |    14.29 |    63.16 |                |
[test:coverage]   app.js                |      100 |    91.67 |    16.67 |      100 |            125 |
[test:coverage]   index.js              |        0 |        0 |        0 |        0 | 1,2,3,4,6,8,10 |
[test:coverage]  client/src/components  |    89.47 |      100 |    43.75 |    89.47 |                |
[test:coverage]   inputs.js             |      100 |      100 |      100 |      100 |                |
[test:coverage]   login.js              |      100 |      100 |      100 |      100 |                |
[test:coverage]   user.js               |    83.33 |      100 |    35.71 |    83.33 |          31,32 |
[test:coverage]  client/src/screens     |       92 |    66.67 |       50 |       92 |                |
[test:coverage]   editor.js             |      100 |      100 |       75 |      100 |                |
[test:coverage]   home.js               |    89.47 |    66.67 |    43.75 |    89.47 |         80,112 |
[test:coverage]   register.js           |      100 |      100 |      100 |      100 |                |
[test:coverage]  client/src/utils       |    69.23 |    58.33 |    19.05 |    69.23 |                |
[test:coverage]   api.js                |    69.23 |    58.33 |    19.05 |    69.23 |... 30,34,35,69 |
[test:coverage]  server/src             |    82.26 |    36.36 |    95.83 |    85.19 |                |
[test:coverage]   auth.js               |       90 |      100 |      100 |    88.89 |             28 |
[test:coverage]   db.js                 |      100 |       75 |      100 |      100 |             59 |
[test:coverage]   index.js              |        0 |        0 |        0 |        0 | 1,2,4,5,6,8,10 |
[test:coverage]   start.js              |      100 |       25 |      100 |      100 |          11,12 |
[test:coverage]  server/src/controllers |    56.25 |    54.17 |       70 |    54.55 |                |
[test:coverage]   auth.js               |    96.55 |    93.75 |      100 |     96.3 |             51 |
[test:coverage]   posts.js              |        0 |        0 |        0 |        0 |... 57,58,59,61 |
[test:coverage]   users.js              |    77.27 |    68.75 |      100 |    76.19 |  8,17,40,46,55 |
[test:coverage]  server/src/routes      |      100 |      100 |      100 |      100 |                |
[test:coverage]   auth.js               |      100 |      100 |      100 |      100 |                |
[test:coverage]   index.js              |      100 |      100 |      100 |      100 |                |
[test:coverage]   posts.js              |      100 |      100 |      100 |      100 |                |
[test:coverage]   users.js              |      100 |      100 |      100 |      100 |                |
[test:coverage] ------------------------|----------|----------|----------|----------|----------------|
[test:coverage] npm run test:coverage --silent exited with code 1


Output of `npm run validate` after installing dependencies.

λ testing-workshop → λ git master* → npm run validate

> testing-workshop@2.0.0 validate /path/to/testing-workshop
> concurrently --names "lint,test:coverage,test:e2e" --prefix "[{name}]" --prefix-colors "bgGreen.reset.bold,bgBlue.reset.bold,bgRed.reset.bold" "npm run lint --silent" "npm run test:coverage --silent" "npm run test:e2e:run --silent"

[lint] npm run lint --silent exited with code 0
[test:e2e] [server] src/auth.js -> dist/auth.js
[test:e2e] [server] src/controllers/auth.js -> dist/controllers/auth.js
[test:e2e] [server] src/controllers/posts.js -> dist/controllers/posts.js
[test:e2e] [server] src/controllers/users.js -> dist/controllers/users.js
[test:e2e] [server] src/db.js -> dist/db.js
[test:e2e] [server] src/index.js -> dist/index.js
[test:e2e] [server] src/routes/auth.js -> dist/routes/auth.js
[test:e2e] [server] src/routes/index.js -> dist/routes/index.js
[test:e2e] [server] src/routes/posts.js -> dist/routes/posts.js
[test:e2e] [server] src/routes/users.js -> dist/routes/users.js
[test:e2e] [server] src/start.js -> dist/start.js
[test:e2e] [server] npm run build:server --silent exited with code 0
[test:coverage]  FAIL   client  client/src/__tests__/app.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module './_Set' from '_getTag.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (node_modules/lodash/_getTag.js:4:11)
[test:coverage]
[test:coverage]  FAIL   client  client/src/components/__tests__/login.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module './_arrayFilter' from '_getSymbols.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (node_modules/lodash/_getSymbols.js:1:108)
[test:coverage]
[test:coverage]  FAIL   server  server/src/__tests__/db.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module 'jest-mock'
[test:coverage]
[test:coverage]       at _load_jestMock (../node_modules/jest-environment-node/build/index.js:17:70)
[test:coverage]
[test:coverage]  FAIL   server  server/__tests__/users.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module 'ansi-regex' from 'convert_ansi.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (../node_modules/pretty-format/build/plugins/convert_ansi.js:12:18)
[test:coverage]
[test:e2e] [client] Creating an optimized production build...
[test:coverage]  PASS   server  server/src/controllers/__tests__/auth.js (19.644s)
[test:coverage]  FAIL   server  server/__tests__/auth.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module './country' from 'index.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (../shared/node_modules/faker/lib/locales/it/address/index.js:5:19)
[test:coverage]
[test:coverage]  PASS   server  server/__tests__/posts.js (5.075s)
[test:e2e] [client] Failed to compile.
[test:e2e] [client]
[test:e2e] [client] ./src/index.js
[test:e2e] [client] Module build failed: Error: ENOENT: no such file or directory, lstat '/path/to/testing-workshop/client/node_modules/@babel/traverse/lib/visitors.js'
[test:e2e] [client]
[test:e2e] [client]
[test:e2e] [client] npm run build:client --silent exited with code 1
[test:e2e] npm run test:e2e:run --silent exited with code 1
[test:coverage]  PASS   client  client/src/components/__tests__/user.js (13.329s)
[test:coverage]
[test:coverage] Test Suites: 5 failed, 3 passed, 8 total
[test:coverage] Tests:       12 passed, 12 total
[test:coverage] Snapshots:   5 passed, 5 total
[test:coverage] Time:        30.424s
[test:coverage] Ran all test suites in 2 projects.
[test:coverage] ------------------------|----------|----------|----------|----------|----------------|
[test:coverage] File                    |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
[test:coverage] ------------------------|----------|----------|----------|----------|----------------|
[test:coverage] All files               |    28.27 |    13.33 |    28.69 |    34.92 |                |
[test:coverage]  client/src             |        0 |        0 |        0 |        0 |                |
[test:coverage]   app.js                |        0 |        0 |        0 |        0 |... 186,192,204 |
[test:coverage]   index.js              |        0 |        0 |        0 |        0 | 1,2,3,4,6,8,10 |
[test:coverage]  client/src/components  |    33.33 |        0 |    33.33 |    46.15 |                |
[test:coverage]   inputs.js             |        0 |        0 |        0 |        0 |... 22,38,42,54 |
[test:coverage]   login.js              |        0 |        0 |        0 |        0 |... 10,11,12,35 |
[test:coverage]   user.js               |      100 |      100 |    42.86 |      100 |                |
[test:coverage]  client/src/screens     |        0 |        0 |        0 |        0 |                |
[test:coverage]   editor.js             |        0 |        0 |        0 |        0 |... 16,17,21,38 |
[test:coverage]   home.js               |        0 |        0 |        0 |        0 |... 112,120,129 |
[test:coverage]   register.js           |      100 |      100 |      100 |      100 |                |
[test:coverage]  client/src/utils       |        0 |        0 |        0 |        0 |                |
[test:coverage]   api.js                |        0 |        0 |        0 |        0 |... 66,67,69,74 |
[test:coverage]  server/src             |    56.45 |    18.18 |     62.5 |    61.11 |                |
[test:coverage]   auth.js               |       20 |        0 |       25 |    22.22 |... 30,31,35,40 |
[test:coverage]   db.js                 |    66.67 |       75 |    64.29 |    69.57 |... 40,44,45,46 |
[test:coverage]   index.js              |        0 |        0 |        0 |        0 | 1,2,4,5,6,8,10 |
[test:coverage]   start.js              |      100 |       25 |      100 |      100 |          11,12 |
[test:coverage]  server/src/controllers |     47.5 |     37.5 |       50 |    48.05 |                |
[test:coverage]   auth.js               |    55.17 |    56.25 |       50 |    55.56 |... 50,51,53,61 |
[test:coverage]   posts.js              |    75.86 |    56.25 |      100 |    75.86 |... 42,45,52,61 |
[test:coverage]   users.js              |        0 |        0 |        0 |        0 |... 51,52,53,55 |
[test:coverage]  server/src/routes      |      100 |      100 |      100 |      100 |                |
[test:coverage]   auth.js               |      100 |      100 |      100 |      100 |                |
[test:coverage]   index.js              |      100 |      100 |      100 |      100 |                |
[test:coverage]   posts.js              |      100 |      100 |      100 |      100 |                |
[test:coverage]   users.js              |      100 |      100 |      100 |      100 |                |
[test:coverage] ------------------------|----------|----------|----------|----------|----------------|
[test:coverage] npm run test:coverage --silent exited with code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testing-workshop@2.0.0 validate: `concurrently --names "lint,test:coverage,test:e2e" --prefix "[{name}]" --prefix-colors "bgGreen.reset.bold,bgBlue.reset.bold,bgRed.reset.bold" "npm run lint --silent" "npm run test:coverage --silent" "npm run test:e2e:run --silent"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testing-workshop@2.0.0 validate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/me/.npm/_logs/2018-02-02T22_49_45_854Z-debug.log


@kentcdodds If you want to peruse the two output logs, it may be worthwhile to verify that the only errors I have remaining are the intentional ones for out of the box (freshly cloned) behavior.

@kentcdodds
Copy link
Owner Author

That's pretty weird. From what it looks like, your machine failed to install dependencies properly. Could you try running: npm run clean && npm run setup and see what happens?

@edm00se
Copy link
Contributor

edm00se commented Feb 2, 2018

🤔 Well, I ran it. I'm not sure it was terribly enlightening.

Output of `npm run clean && npm run setup`.

λ testing-workshop → λ git master → npm run clean && npm run setup

> testing-workshop@2.0.0 clean /path/to/testing-workshop
> rimraf node_modules ./shared/node_modules ./client/node_modules ./server/node_modules



> testing-workshop@2.0.0 setup /path/to/testing-workshop
> node ./scripts/verify && node ./scripts/install && npm run validate

🎉  Congrats! Your system is setup properly
You should be good to install and run things.
📦  Installing dependencies via npm install
🔑  starting install in /path/to/testing-workshop
npm WARN deprecated markdown-to-ast@3.4.0: See https://github.com/textlint/textlint/issues/455

> husky@0.14.3 install /path/to/testing-workshop/node_modules/husky
> node ./bin/install.js

husky
setting up Git hooks
done


> uglifyjs-webpack-plugin@0.4.6 postinstall /path/to/testing-workshop/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> cypress@1.4.1 postinstall /path/to/testing-workshop/node_modules/cypress
> node index.js --exec install

Installing Cypress (version: 1.4.1)

 ✔  Downloaded Cypress
 ✔  Unzipped Cypress
 ✔  Finished Installation /path/to/testing-workshop/node_modules/cypress/dist/Cypress

You can now open Cypress by running: node_modules/.bin/cypress open

https://on.cypress.io/installing-cypress
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 976 packages in 427.064s
🎉  finished installing dependencies in "/path/to/testing-workshop"
🔑  starting install in /path/to/testing-workshop/shared
npm notice created a lockfile as package-lock.json. You should commit this file.
added 18 packages in 6.747s
🎉  finished installing dependencies in "/path/to/testing-workshop/shared"
🔑  starting install in /path/to/testing-workshop/server

> nodemon@1.14.12 postinstall /path/to/testing-workshop/server/node_modules/nodemon
> node -e "console.log('\u001b[32mLove nodemon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/nodemon/donate\u001b[0m\n')" || exit 0

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 493 packages in 99.822s
🎉  finished installing dependencies in "/path/to/testing-workshop/server"
🔑  starting install in /path/to/testing-workshop/client

> uglifyjs-webpack-plugin@0.4.6 postinstall /path/to/testing-workshop/client/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js

npm WARN @babel/plugin-syntax-dynamic-import@7.0.0-beta.34 requires a peer of @babel/core@7.0.0-beta.34 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1675 packages in 228.552s
🎉  finished installing dependencies in "/path/to/testing-workshop/client"
👍  all dependencies installed

> testing-workshop@2.0.0 validate /path/to/testing-workshop
> concurrently --names "lint,test:coverage,test:e2e" --prefix "[{name}]" --prefix-colors "bgGreen.reset.bold,bgBlue.reset.bold,bgRed.reset.bold" "npm run lint --silent" "npm run test:coverage --silent" "npm run test:e2e:run --silent"

[test:e2e] [server] src/auth.js -> dist/auth.js
[test:e2e] [server] src/controllers/auth.js -> dist/controllers/auth.js
[test:e2e] [server] src/controllers/posts.js -> dist/controllers/posts.js
[test:e2e] [server] src/controllers/users.js -> dist/controllers/users.js
[test:e2e] [server] src/db.js -> dist/db.js
[test:e2e] [server] src/index.js -> dist/index.js
[test:e2e] [server] src/routes/auth.js -> dist/routes/auth.js
[test:e2e] [server] src/routes/index.js -> dist/routes/index.js
[test:e2e] [server] src/routes/posts.js -> dist/routes/posts.js
[test:e2e] [server] src/routes/users.js -> dist/routes/users.js
[test:e2e] [server] src/start.js -> dist/start.js
[test:e2e] [server] npm run build:server --silent exited with code 0
[test:coverage]  FAIL   server  server/src/controllers/__tests__/auth.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module './company' from 'index.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (../shared/node_modules/faker/lib/locales/de_AT/index.js:5:17)
[test:coverage]
[lint] npm run lint --silent exited with code 0
[test:e2e] [client] Creating an optimized production build...
[test:coverage]  PASS   server  server/__tests__/posts.js (29.058s)
[test:coverage]  PASS   client  client/src/components/__tests__/user.js (28.623s)
[test:coverage]  FAIL   client  client/src/__tests__/app.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module 'buffer-equal-constant-time' from 'index.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (../shared/node_modules/jwa/index.js:1:108)
[test:coverage]
[test:coverage]  FAIL   server  server/__tests__/users.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     ENOENT: no such file or directory, stat '/path/to/testing-workshop/shared/node_modules/faker/lib/locales/nb_NO/address/street_prefix.js'
[test:coverage]
[test:coverage]       at Object.statSync (../node_modules/graceful-fs/polyfills.js:297:22)
[test:coverage]       at Object.<anonymous> (../shared/node_modules/faker/lib/locales/nb_NO/address/index.js:5:25)
[test:coverage]
[test:coverage]  FAIL   server  server/src/__tests__/db.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module './locales/nl' from 'locales.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (../shared/node_modules/faker/lib/locales.js:27:17)
[test:coverage]
[test:coverage]  FAIL   server  server/__tests__/auth.js
[test:coverage]   ● Test suite failed to run
[test:coverage]
[test:coverage]     Cannot find module './words' from 'index.js'
[test:coverage]
[test:coverage]       at Resolver.resolveModule (../node_modules/jest-resolve/build/index.js:194:17)
[test:coverage]       at Object.<anonymous> (../shared/node_modules/faker/lib/locales/sk/lorem/index.js:3:15)
[test:coverage]
[test:coverage]  PASS   client  client/src/components/__tests__/login.js (16.062s)
[test:coverage]
[test:coverage] Test Suites: 5 failed, 3 passed, 8 total
[test:coverage] Tests:       7 passed, 7 total
[test:coverage] Snapshots:   0 total
[test:coverage] Time:        65.701s
[test:coverage] Ran all test suites in 2 projects.
[test:coverage] ------------------------|----------|----------|----------|----------|----------------|
[test:coverage] File                    |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
[test:coverage] ------------------------|----------|----------|----------|----------|----------------|
[test:coverage] All files               |    26.26 |     7.64 |    25.83 |    31.94 |                |
[test:coverage]  client/src             |        0 |        0 |        0 |        0 |                |
[test:coverage]   app.js                |        0 |        0 |        0 |        0 |... 186,192,204 |
[test:coverage]   index.js              |        0 |        0 |        0 |        0 | 1,2,3,4,6,8,10 |
[test:coverage]  client/src/components  |      100 |      100 |       50 |      100 |                |
[test:coverage]   inputs.js             |      100 |      100 |      100 |      100 |                |
[test:coverage]   login.js              |      100 |      100 |      100 |      100 |                |
[test:coverage]   user.js               |      100 |      100 |    42.86 |      100 |                |
[test:coverage]  client/src/screens     |        0 |        0 |        0 |        0 |                |
[test:coverage]   editor.js             |        0 |        0 |        0 |        0 |... 16,17,21,38 |
[test:coverage]   home.js               |        0 |        0 |        0 |        0 |... 112,120,129 |
[test:coverage]   register.js           |      100 |      100 |      100 |      100 |                |
[test:coverage]  client/src/utils       |        0 |        0 |        0 |        0 |                |
[test:coverage]   api.js                |        0 |        0 |        0 |        0 |... 66,67,69,74 |
[test:coverage]  server/src             |       50 |    13.64 |    54.17 |     53.7 |                |
[test:coverage]   auth.js               |       20 |        0 |       25 |    22.22 |... 30,31,35,40 |
[test:coverage]   db.js                 |    51.85 |       50 |       50 |    52.17 |... 40,44,45,46 |
[test:coverage]   index.js              |        0 |        0 |        0 |        0 | 1,2,4,5,6,8,10 |
[test:coverage]   start.js              |      100 |       25 |      100 |      100 |          11,12 |
[test:coverage]  server/src/controllers |    28.75 |    18.75 |       30 |    29.87 |                |
[test:coverage]   auth.js               |     3.45 |        0 |        0 |      3.7 |... 53,60,61,63 |
[test:coverage]   posts.js              |    75.86 |    56.25 |      100 |    75.86 |... 42,45,52,61 |
[test:coverage]   users.js              |        0 |        0 |        0 |        0 |... 51,52,53,55 |
[test:coverage]  server/src/routes      |      100 |      100 |      100 |      100 |                |
[test:coverage]   auth.js               |      100 |      100 |      100 |      100 |                |
[test:coverage]   index.js              |      100 |      100 |      100 |      100 |                |
[test:coverage]   posts.js              |      100 |      100 |      100 |      100 |                |
[test:coverage]   users.js              |      100 |      100 |      100 |      100 |                |
[test:coverage] ------------------------|----------|----------|----------|----------|----------------|
[test:coverage] Jest: "global" coverage threshold for branches (10%) not met: 7.64%
[test:coverage] npm run test:coverage --silent exited with code 1
[test:e2e] [client] Failed to compile.
[test:e2e] [client]
[test:e2e] [client] ./src/assets/github.svg
[test:e2e] [client] Module build failed: Error: ENOENT: no such file or directory, open '/path/to/testing-workshop/client/node_modules/lodash/map.js'
[test:e2e] [client]
[test:e2e] [client]
[test:e2e] [client] npm run build:client --silent exited with code 1
[test:e2e] npm run test:e2e:run --silent exited with code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testing-workshop@2.0.0 validate: `concurrently --names "lint,test:coverage,test:e2e" --prefix "[{name}]" --prefix-colors "bgGreen.reset.bold,bgBlue.reset.bold,bgRed.reset.bold" "npm run lint --silent" "npm run test:coverage --silent" "npm run test:e2e:run --silent"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testing-workshop@2.0.0 validate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/me/.npm/_logs/2018-02-02T23_24_06_777Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testing-workshop@2.0.0 setup: `node ./scripts/verify && node ./scripts/install && npm run validate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testing-workshop@2.0.0 setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/me/.npm/_logs/2018-02-02T23_24_06_835Z-debug.log


Output of `ls shared/node_modules/`

λ testing-workshop → λ git master* → ls shared/node_modules
base64url                   faker         jws               lodash.isinteger      lodash.isstring  ms
buffer-equal-constant-time  jsonwebtoken  lodash.includes   lodash.isnumber       lodash.omit      safe-buffer
ecdsa-sig-formatter         jwa           lodash.isboolean  lodash.isplainobject  lodash.once      xtend

@kentcdodds
Copy link
Owner Author

Could you verify that shared/node_modules/faker/lib/locales/sk/lorem/words.js exists?

It's saying it can't find that module, but if it's there for you then I don't know what's up :-(

@edm00se
Copy link
Contributor

edm00se commented Feb 2, 2018

Confirmed, it exists and exports an array of Latin looking words. Probably a module resolution issue? I did see in the logs above an issue with optional dep fsevents being skipped since os type "linux" and "darwin" weren't met.

🤔 😞

@kentcdodds
Copy link
Owner Author

Sounds like it. Super odd that nobody else appears to be experiencing this issue 🤔 I just tried again to be sure there's not a dependency problem and it worked for me.

@edm00se
Copy link
Contributor

edm00se commented Feb 3, 2018

For the record, this seems isolated to my Windows System Linux ("Bash on Ubuntu on Windows") environment. My cloned copy that ran purely on Win10 in PowerShell seems to run perfectly fine with both the setup and validate scripts.

@davidnomo
Copy link

Hi Kent,
When i was doing testes i got an error. i am not sure what is creating it.

Here is the error info.

FAIL demo/integration/tests/users.js
● can get 2 users at offset 3

TypeError: Cannot read property 'all' of undefined
  
  at Object.<anonymous>.test (demo/integration/__tests__/users.js:41:28)

✓ can get users (6ms)
✕ can get 2 users at offset 3

Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 passed, 2 total
Snapshots: 0 total
Time: 1.387s, estimated 2s

Every thinig is exactly same as you showed at FEM.
Here is how promise is calling 'return Promise.all([fiveUsersPromise, twoUsersPromise])'

I have Node v9.5.0, npm 5.6.0, yarn 1.3.2

@kentcdodds
Copy link
Owner Author

@davidnomo, it looks like you're on an old version of master or a different branch. Make sure you're on the master branch when you run npm run setup :)

@kentcdodds
Copy link
Owner Author

I've given the workshop now and I don't think there were any serious setup issues so I'm going to close this issue. Thanks everyone!

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

No branches or pull requests

5 participants