frontendmasters / intro-node-js Goto Github PK
View Code? Open in Web Editor NEW[Course] Code for Introduction to Node.js
Home Page: https://frontendmasters.com/courses/node-js/
[Course] Code for Introduction to Node.js
Home Page: https://frontendmasters.com/courses/node-js/
I would suggest to add .nvmrc.
npm i
doesn't work properly for me with node v12
I am at fixing modules and I followed the same and even tried to replace it with the solution but it did not work.
data › users
expect(received).toHaveLength(expected)
Matcher error: received value must have a length property whose value
must be a number
Received has value: undefined
5 | describe('data', () => {
6 | test('users', () => {
> 7 | expect(data.users).toHaveLength(1)
| ^
8 | })
9 | test('posts', () => {
10 | expect(data.posts).toHaveLength(3)
at Object.toHaveLength (exercises/modules/node/test.js:7:24)
● data › posts
expect(received).toHaveLength(expected)
Matcher error: received value must have a length property whose value must be a number
Received has value: undefined
8 | })
9 | test('posts', () => {
> 10 | expect(data.posts).toHaveLength(3)
| ^
11 | })
12 | })
13 |
at Object.toHaveLength (exercises/modules/node/test.js:10:24)
● api › getUserById
TypeError: Cannot read property 'find' of undefined
4 | // simulate API call
5 | setTimeout(() => {
> 6 | const user = data.users.find(user => user.id === id)
| ^
7 | cb(user)
8 | }, 150)
9 | }
at find (exercises/modules/node/api.js:6:29)
at Timeout.callback [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:671:19)
● api › getUserById
expect.assertions(1)
Expected one assertion to be called but received zero assertion calls.
14 | describe('api', () => {
15 | test('getUserById', done => {
> 16 | expect.assertions(1)
| ^
17 | api.getUserById(1, user => {
18 | expect(user.id).toBe(1)
19 | done()
at Object.assertions (exercises/modules/node/test.js:16:12)
● api › getPostsForUser
TypeError: Cannot read property 'filter' of undefined
12 | // simulate API call
13 | setTimeout(() => {
> 14 | const posts = data.posts.filter(post => post.createdBy === userId)
| ^
15 | cb(posts)
16 | }, 150)
17 | }
at filter (exercises/modules/node/api.js:14:30)
at Timeout.callback [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:671:19)
● app › showPostsForCurrentUser
TypeError: Cannot read property 'filter' of undefined
12 | // simulate API call
13 | setTimeout(() => {
> 14 | const posts = data.posts.filter(post => post.createdBy === userId)
| ^
15 | cb(posts)
16 | }, 150)
17 | }
at filter (exercises/modules/node/api.js:14:30)
at Timeout.callback [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:671:19)
● app › showUserProfile
TypeError: Cannot read property 'find' of undefined
4 | // simulate API call
5 | setTimeout(() => {
> 6 | const user = data.users.find(user => user.id === id)
| ^
7 | cb(user)
8 | }, 150)
9 | }
at find (exercises/modules/node/api.js:6:29)
at Timeout.callback [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:671:19)
Test Suites: 2 failed, 2 total
Tests: 6 failed, 6 total
Snapshots: 0 total
Time: 1.813s, estimated 2s
Ran all test suites.
Error msg
====>
node.0.0
Node.js vnode.0.0 is only available in 32-bit.
Hello, I have PowerShell in the terminal, because I can't install Bash, and I can't install nvm. I installed node(14.08.0) from the website and I can run npm install but none of the nvm commands work. any advice please?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.