davidmason / esnext-quickstart Goto Github PK
View Code? Open in Web Editor NEWThis project forked from nkbt/esnext-quickstart
Bring compilation and code validation to your front-end development process
License: MIT License
This project forked from nkbt/esnext-quickstart
Bring compilation and code validation to your front-end development process
License: MIT License
See section "Code Completion" at http://www.jayway.com/2014/03/28/running-scripts-with-npm/
All the testing, linting, and building tools should only be needed during development.
The default provided test checks for the text "Hello" like this:
describe('Content', () => {
it('Should render greetings', () => {
const content = TestUtils.renderIntoDocument(<Content />);
const h1 = TestUtils.findRenderedDOMComponentWithTag(content, 'h1');
expect(h1).toBeDom();
expect(h1).toHaveText('Hello');
});
});
This passes, and changing to expect(h1).not.toHaveText('Hello');
fails, but if the text in the referenced component is changed to something other than "Hello", the original test still passes, and the inverse test still fails.
Possibilities:
toHaveText()
is not working and always returns true
.expect()
in the right form. This is supported by some very unreadable output in the failure message - it prints out a whole object with many properties as the thing that should not have the text in it.Running npm build
does nothing, no directory is created, but copying the command out of package.json
and running it manually on the command line shows:
[damason@hiddlins esnext-quickstart]$ rm -rf public && cp -pr src/static/ public && webpack
bash: webpack: command not found...
When the command is run this way, the public directory is created.
Something is preventing the public directory being created with npm build
. webpack is a dev dependency so it may be available.
The correct command to run is npm run build
. This fails with an error message due to a syntax error in the webpack config. It also fails if npm install
has not been run yet, with message "sh: webpack: command not found".
The appropriate error is shown for the webpack config syntax error.
A better error message could be shown when webpack is not found, instructing to run npm install
or npm install -g webpack
. FIled as #4
This is already true.
npm build
that it is not a valid command (or make it a valid command).npm run build
fails if npm install
has not been run. The error message says that the command "webpack" is not found.
Better if it also instructed developers to run npm install
or npm install -g webpack
to fix the problem.
npm start
and open localhost:3000
in a browser. Open the javascript log pane of the browser.Content
component. The change should be reflected in the browser, and log messages indicate that hot update has occurred.npm start
again.Content
component.The browser log shows that hot update has occurred, but the new paragraph is not shown in the browser window.
It appears that opening 0.0.0.0:3000
in the browser, rather than localhost:3000
allows the hot-swap to properly detect disconnection. With 0.0.0.0:3000
open, terminating the watch server causes the browser log to show "[WDS] Disconnected", and when the server is restarted the browser continues to show changes to the content.
Listening on http://0.0.0.0:3000
so that developers are prompted to open the URL with the better behaviour.localhost
is used and show a warning.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.