{"id":324045,"date":"2021-05-31T15:00:22","date_gmt":"2021-05-31T15:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=324045"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=324045","title":{"rendered":"\u041a\u0430\u043a \u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0443\u044e \u0441\u0432\u043e\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b NPM"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f7a\/6cf\/21d\/f7a6cf21d5a57ba0b4c5a7773f02c207.png\" width=\"780\" height=\"439\"><figcaption><\/figcaption><\/figure>\n<h2>\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 package.json \u0438 \u0442\u043e, \u043a\u0430\u043a \u044f \u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e<\/h2>\n<p>\u0412 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0441\u044c \u0438\u043b\u0438 \u043f\u0438\u0448\u0443 \u0441\u0430\u043c, \u043e\u0431\u044b\u0447\u043d\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0442\u043e, \u043a\u0430\u043a \u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0438\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<ul>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>CI-\u0441\u043a\u0440\u0438\u043f\u0442&nbsp;<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/p>\n<ul>\n<li>\n<p>\u0421\u0442\u043e\u043f \u0442\u043e\u0447\u043a\u0430 (Stop dot)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>\u0418\u043c\u0435\u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 #<\/h4>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c, \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0438\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 <a href=\"https:\/\/github.com\/bahmutov\/cypress-example-forms\"><u>bahmutov\/cypress-example-forms<\/u><\/a> \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u044d\u0442\u0438 \u0442\u0440\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\"   } }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u043e \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm run<\/code><\/p>\n<pre><code class=\"json\">$ npm run Lifecycle scripts included in cypress-example-forms:   start     parcel serve index.html  available via `npm run-script`:   format     prettier --write 'cypress\/**\/*.js'   build     parcel build index.html<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/p>\n<pre><code class=\"json\">$ npm run-script format<\/code><\/pre>\n<p>\u0423 <code>run-script<\/code> \u0435\u0441\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c <code>run<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 <code>npm run<\/code> &lt;script name&gt;:<\/p>\n<pre><code class=\"json\">$ npm run format ## the start command is special, you can skip the \"run\" word $ npm start<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Yarn \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u0430\u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 &#171;run&#187;:<\/p>\n<pre><code class=\"json\">$ yarn run build ## is the same as $ yarn build<\/code><\/pre>\n<p>\u041f\u043e\u0437\u0436\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b Cypress, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u0434\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Cypress \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438 \u043d\u0430 CI.<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\"   } }<\/code><\/pre>\n<p><strong>\u0421\u043e\u0432\u0435\u0442<\/strong>: \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 &#171;cy:open&#187; \u0438 &#171;cy:run&#187;. \u041f\u0440\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438 \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 &#171;cypress:open&#187; \u0438 &#171;cypress:run&#187;.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u0438\u0434\u0435\u043e \u043e\u0431 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0438\u0436\u0435:<\/p>\n<p><iframe id=\"60b4bf5d464e6db5e5b954bd\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60b4bf5d464e6db5e5b954bd\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<h4>\u0417\u0430\u043f\u0443\u0441\u043a \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 #<\/h4>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 Cypress \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm run cy:open<\/code>. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043c\u044b \u0437\u0430\u043a\u0440\u043e\u0435\u043c Cypress Test Runner, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"https:\/\/github.com\/bahmutov\/start-server-and-test\"><u>start-server-and-test<\/u><\/a>. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0435\u0435 \u043a\u0430\u043a dev-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>npm i -D start-server-and-test<\/code> \u0438\u043b\u0438 <code>yarn add -D start-server-and-test<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Cypress. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u0441\u043a\u0440\u0438\u043f\u0442 dev:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\",     \"dev\": \"start-test-and-test start 1234 cy:open\"   } }<\/code><\/pre>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043c\u043e\u0433\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>npm run dev<\/code> \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0421\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b NPM: \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <code>npm start<\/code> \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. 1234 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430 &#8212; \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <code>start-server-and-test<\/code> \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e <code>localhost:1234<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442, \u043e\u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <code>npm run cy:open<\/code>. \u041a\u043e\u0433\u0434\u0430 \u044f \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e Cypress, \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435&nbsp;<code>node_modules\/.bin:<\/code> \u0434\u0432\u0430 \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u0430 <code>start-test-and-test<\/code> \u0438 <code>start-test<\/code>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f \u043c\u043e\u0433\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<pre><code class=\"json\">\"dev\": \"start-test start 1234 cy:open\"<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>npm start<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0439, <code>start-test<\/code> \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c:<\/p>\n<pre><code class=\"json\">\"dev\": \"start-test 1234 cy:open\"<\/code><\/pre>\n<p><strong>\u0421\u043e\u0432\u0435\u0442<\/strong>: \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0432\u0441\u0435\u0445 \u043e\u043f\u0446\u0438\u0439 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a <a href=\"https:\/\/github.com\/bahmutov\/start-server-and-test#start-server-and-test\"><u>README start-server-and-test<\/u><\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u043c\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <code>dev<\/code> \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <code>e2e<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Next.js \u043e\u0431\u044b\u0447\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 <code>dev<\/code> \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>next<\/code> , \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 <a href=\"https:\/\/github.com\/bahmutov\/next-and-cypress-example\"><u>bahmutov\/next-and-cypress-example<\/u><\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <code>e2e<\/code>:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"dev\": \"next\",     \"build\": \"next build\",     \"start\": \"next start\",     \"e2e\": \"start-test dev 3000 cy:open\",     \"cy:open\": \"cypress open\",     \"pree2e\": \"rm -rf .nyc_output coverage .next || true\",     \"check-coverage-limits\": \"check-total --min 100\"   } }<\/code><\/pre>\n<h4>\u0421\u043a\u0440\u0438\u043f\u0442 CI #<\/h4>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b, \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044f Cypress. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u044b\u0447\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>cy:run<\/code> \u0447\u0435\u0440\u0435\u0437 <code>npm test<\/code> \u0438\u043b\u0438 <code>npm t<\/code>:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\",     \"dev\": \"start-test 1234 cy:open\",     \"test\": \"start-test 1234 cy:run\"   } }<\/code><\/pre>\n<p>\u0412\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"json\">npm it ## equivalent to npm install npm test<\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b <code>package-lock.json<\/code> \u043f\u0440\u0438 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438<\/p>\n<pre><code class=\"json\">npm cit ## equivalent to npm ci npm test<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 &#171;\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435&#187; \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0438\u0434\u0435\u043e.<\/p>\n<p><iframe id=\"60b4c073ffc548cb08607781\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60b4c073ffc548cb08607781\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<h4>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a #<\/h4>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0440\u0430\u0441\u0442\u0435\u0442, \u0430 \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u0434\u043b\u0438\u043d\u0430 \u0438\u043c\u0435\u043d\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0438\u0441\u043b\u0430\u043d\u0434\u0441\u043a\u043e\u0433\u043e \u0432\u0443\u043b\u043a\u0430\u043d\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <code>cypress run<\/code>: \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 Chrome \u0438 \u0442.\u0434.<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\",     \"cy:run:record\": \"cypress run --record\",     \"cy:run:chrome\": \"cypress run --browser chrome\",     \"cy:run:record:chrome\": \"cypress run --record --browser chrome\",     \"dev\": \"start-test 1234 cy:open\",     \"test\": \"start-test 1234 cy:run\"   } }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"https:\/\/github.com\/bahmutov\/npm-quick-run\"><u>npm-quick-run<\/u><\/a>. \u0418\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>npm i -g npm-quick-run<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>nr alias<\/code> \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e \u0435\u0433\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0443:<\/p>\n<pre><code class=\"json\">nr d ## same as npm run dev<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430, <code>npm-quick-run<\/code> \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<pre><code class=\"json\">$ nr cy running command with prefix \"cy\" Several scripts start with \"cy\" cy:open, cy:run, cy:run:record, cy:run:chrome, cy:run:record:chrome<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c <code>:<\/code> (\u0437\u043d\u0430\u043a <code>-<\/code> \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442). \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043b\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>:<\/code> \u0438\u043b\u0438 <code>-<\/code> \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>nr<\/code>. \u042f \u043b\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>-<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043e\u0433\u0443 \u043d\u0430\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0438 Shift.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u043c Cypress<\/p>\n<pre><code class=\"json\">$ nr c-o ## finds the script \"cy:open\" and runs it<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435\u0441\u0442\u044b \u0432 Chrome<\/p>\n<pre><code class=\"json\">$ nr c-r-c ## finds the script \"cy:run:chrome\" and runs it<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>npm-quick-run<\/code> \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0448 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 <code>cypress run<\/code> \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c CLI-\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\",     \"dev\": \"start-test 1234 cy:open\",     \"test\": \"start-test 1234 cy:run\"   } }<\/code><\/pre>\n<pre><code class=\"json\">## record tests nr c-r --record ## record tests in Chrome nr c-r --record --browser chrome<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a NPM \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u043d\u0438\u0436\u0435<\/p>\n<p><iframe id=\"60b4c144d18872cafa2339b2\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60b4c144d18872cafa2339b2\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<h4>\u0421\u0442\u043e\u043f \u0442\u043e\u0447\u043a\u0430 (Stop dot)<\/h4>\n<p>\u0412 <code>npm-quick-run<\/code> \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043b\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0441\u0438\u043c\u0432\u043e\u043b \u0442\u043e\u0447\u043a\u0438 <code>.<\/code> \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430, \u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u043b\u043e\u0432. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b <code>package.json<\/code>:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"cypress\": \"cypress -help\",     \"cypress:open\": \"cypress open\",     \"cypress:run\": \"cypress run\",     \"cypress:run:record\": \"cypress run --record\"   } }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 &#171;cypress&#187; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0441 &#171;.&#187; \u0432 \u043a\u043e\u043d\u0446\u0435:<\/p>\n<pre><code class=\"json\"># same as \"npm run cypress\" $ nr c. # finds the script with a single word starting with \"c\"  # same as \"npm run cypress:open\" $ nr c-o.  # same as \"npm run cypress:run\" $ nr c-r.  # these commands are equivalent $ npm run cypress:run:record $ yarn cypress:run:record $ nr c-r-r $ nr c-r-r.<\/code><\/pre>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u044f \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u0438\u043c\u0432\u043e\u043b\u044b <code>-<\/code> \u0438 <code>.<\/code> \u0434\u043b\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432 \u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u043c\u043e\u0433\u0443 \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0445 \u0431\u0435\u0437 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0438 Shift.<\/p>\n<hr>\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/NbQi\/\"><strong>&#171;Node.js Developer&#187;<\/strong><\/a>. \u0412\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u0435\u043c\u043e-\u0443\u0440\u043e\u043a <a href=\"https:\/\/otus.pw\/mP0Z\/\">\u00abTypeScript \u0432 Node.js \u0434\u043b\u044f server-side \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439\u00bb<\/a>. \u041d\u0430 \u0437\u0430\u043d\u044f\u0442\u0438\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c:<br \/>&#8212; \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c TypeScript \u0432 Node.js;<br \/>&#8212; \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 ts-node \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438;<br \/>&#8212; \u0434\u0432\u0438\u0436\u043e\u043a deno \u2014 \u043d\u043e\u0432\u044b\u0439 Node.js \u0441 TypeScript.  <\/p>\n<\/blockquote>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/560176\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/560176\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 package.json \u0438 \u0442\u043e, \u043a\u0430\u043a \u044f \u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e<\/h2>\n<p>\u0412 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0441\u044c \u0438\u043b\u0438 \u043f\u0438\u0448\u0443 \u0441\u0430\u043c, \u043e\u0431\u044b\u0447\u043d\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0442\u043e, \u043a\u0430\u043a \u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0438\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<ul>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>CI-\u0441\u043a\u0440\u0438\u043f\u0442&nbsp;<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a<\/p>\n<ul>\n<li>\n<p>\u0421\u0442\u043e\u043f \u0442\u043e\u0447\u043a\u0430 (Stop dot)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>\u0418\u043c\u0435\u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 #<\/h4>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c, \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0438\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 <a href=\"https:\/\/github.com\/bahmutov\/cypress-example-forms\"><u>bahmutov\/cypress-example-forms<\/u><\/a> \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u044d\u0442\u0438 \u0442\u0440\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\"   } }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u043e \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm run<\/code><\/p>\n<pre><code class=\"json\">$ npm run Lifecycle scripts included in cypress-example-forms:   start     parcel serve index.html  available via `npm run-script`:   format     prettier --write 'cypress\/**\/*.js'   build     parcel build index.html<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/p>\n<pre><code class=\"json\">$ npm run-script format<\/code><\/pre>\n<p>\u0423 <code>run-script<\/code> \u0435\u0441\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c <code>run<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 <code>npm run<\/code> &lt;script name&gt;:<\/p>\n<pre><code class=\"json\">$ npm run format ## the start command is special, you can skip the \"run\" word $ npm start<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Yarn \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u0430\u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 &#171;run&#187;:<\/p>\n<pre><code class=\"json\">$ yarn run build ## is the same as $ yarn build<\/code><\/pre>\n<p>\u041f\u043e\u0437\u0436\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b Cypress, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u0434\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Cypress \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438 \u043d\u0430 CI.<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\"   } }<\/code><\/pre>\n<p><strong>\u0421\u043e\u0432\u0435\u0442<\/strong>: \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 &#171;cy:open&#187; \u0438 &#171;cy:run&#187;. \u041f\u0440\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438 \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 &#171;cypress:open&#187; \u0438 &#171;cypress:run&#187;.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u0438\u0434\u0435\u043e \u043e\u0431 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0438\u0436\u0435:<\/p>\n<p><iframe id=\"60b4bf5d464e6db5e5b954bd\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60b4bf5d464e6db5e5b954bd\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<h4>\u0417\u0430\u043f\u0443\u0441\u043a \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 #<\/h4>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 Cypress \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm run cy:open<\/code>. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043c\u044b \u0437\u0430\u043a\u0440\u043e\u0435\u043c Cypress Test Runner, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"https:\/\/github.com\/bahmutov\/start-server-and-test\"><u>start-server-and-test<\/u><\/a>. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0435\u0435 \u043a\u0430\u043a dev-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>npm i -D start-server-and-test<\/code> \u0438\u043b\u0438 <code>yarn add -D start-server-and-test<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Cypress. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u0441\u043a\u0440\u0438\u043f\u0442 dev:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\",     \"dev\": \"start-test-and-test start 1234 cy:open\"   } }<\/code><\/pre>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043c\u043e\u0433\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>npm run dev<\/code> \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0421\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b NPM: \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <code>npm start<\/code> \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. 1234 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430 &#8212; \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <code>start-server-and-test<\/code> \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e <code>localhost:1234<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442, \u043e\u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <code>npm run cy:open<\/code>. \u041a\u043e\u0433\u0434\u0430 \u044f \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e Cypress, \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435&nbsp;<code>node_modules\/.bin:<\/code> \u0434\u0432\u0430 \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u0430 <code>start-test-and-test<\/code> \u0438 <code>start-test<\/code>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f \u043c\u043e\u0433\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<pre><code class=\"json\">\"dev\": \"start-test start 1234 cy:open\"<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>npm start<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0439, <code>start-test<\/code> \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c:<\/p>\n<pre><code class=\"json\">\"dev\": \"start-test 1234 cy:open\"<\/code><\/pre>\n<p><strong>\u0421\u043e\u0432\u0435\u0442<\/strong>: \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0432\u0441\u0435\u0445 \u043e\u043f\u0446\u0438\u0439 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a <a href=\"https:\/\/github.com\/bahmutov\/start-server-and-test#start-server-and-test\"><u>README start-server-and-test<\/u><\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u043c\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <code>dev<\/code> \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <code>e2e<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Next.js \u043e\u0431\u044b\u0447\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 <code>dev<\/code> \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>next<\/code> , \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 <a href=\"https:\/\/github.com\/bahmutov\/next-and-cypress-example\"><u>bahmutov\/next-and-cypress-example<\/u><\/a> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <code>e2e<\/code>:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"dev\": \"next\",     \"build\": \"next build\",     \"start\": \"next start\",     \"e2e\": \"start-test dev 3000 cy:open\",     \"cy:open\": \"cypress open\",     \"pree2e\": \"rm -rf .nyc_output coverage .next || true\",     \"check-coverage-limits\": \"check-total --min 100\"   } }<\/code><\/pre>\n<h4>\u0421\u043a\u0440\u0438\u043f\u0442 CI #<\/h4>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b, \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044f Cypress. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u044b\u0447\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>cy:run<\/code> \u0447\u0435\u0440\u0435\u0437 <code>npm test<\/code> \u0438\u043b\u0438 <code>npm t<\/code>:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\",     \"dev\": \"start-test 1234 cy:open\",     \"test\": \"start-test 1234 cy:run\"   } }<\/code><\/pre>\n<p>\u0412\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"json\">npm it ## equivalent to npm install npm test<\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b <code>package-lock.json<\/code> \u043f\u0440\u0438 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438<\/p>\n<pre><code class=\"json\">npm cit ## equivalent to npm ci npm test<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 &#171;\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435&#187; \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0438\u0434\u0435\u043e.<\/p>\n<p><iframe id=\"60b4c073ffc548cb08607781\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60b4c073ffc548cb08607781\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<h4>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a #<\/h4>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0440\u0430\u0441\u0442\u0435\u0442, \u0430 \u0441\u0440\u0435\u0434\u043d\u044f\u044f \u0434\u043b\u0438\u043d\u0430 \u0438\u043c\u0435\u043d\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0438\u0441\u043b\u0430\u043d\u0434\u0441\u043a\u043e\u0433\u043e \u0432\u0443\u043b\u043a\u0430\u043d\u0430. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <code>cypress run<\/code>: \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 Chrome \u0438 \u0442.\u0434.<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\",     \"cy:run:record\": \"cypress run --record\",     \"cy:run:chrome\": \"cypress run --browser chrome\",     \"cy:run:record:chrome\": \"cypress run --record --browser chrome\",     \"dev\": \"start-test 1234 cy:open\",     \"test\": \"start-test 1234 cy:run\"   } }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"https:\/\/github.com\/bahmutov\/npm-quick-run\"><u>npm-quick-run<\/u><\/a>. \u0418\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>npm i -g npm-quick-run<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>nr alias<\/code> \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e \u0435\u0433\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0443:<\/p>\n<pre><code class=\"json\">nr d ## same as npm run dev<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430, <code>npm-quick-run<\/code> \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<pre><code class=\"json\">$ nr cy running command with prefix \"cy\" Several scripts start with \"cy\" cy:open, cy:run, cy:run:record, cy:run:chrome, cy:run:record:chrome<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c <code>:<\/code> (\u0437\u043d\u0430\u043a <code>-<\/code> \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442). \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043b\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>:<\/code> \u0438\u043b\u0438 <code>-<\/code> \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>nr<\/code>. \u042f \u043b\u0438\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>-<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043e\u0433\u0443 \u043d\u0430\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0438 Shift.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u043c Cypress<\/p>\n<pre><code class=\"json\">$ nr c-o ## finds the script \"cy:open\" and runs it<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435\u0441\u0442\u044b \u0432 Chrome<\/p>\n<pre><code class=\"json\">$ nr c-r-c ## finds the script \"cy:run:chrome\" and runs it<\/code><\/pre>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>npm-quick-run<\/code> \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0448 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 <code>cypress run<\/code> \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c CLI-\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"format\": \"prettier --write 'cypress\/**\/*.js'\",     \"start\": \"parcel serve index.html\",     \"build\": \"parcel build index.html\",     \"cy:open\": \"cypress open\",     \"cy:run\": \"cypress run\",     \"dev\": \"start-test 1234 cy:open\",     \"test\": \"start-test 1234 cy:run\"   } }<\/code><\/pre>\n<pre><code class=\"json\">## record tests nr c-r --record ## record tests in Chrome nr c-r --record --browser chrome<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a NPM \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u043d\u0438\u0436\u0435<\/p>\n<p><iframe id=\"60b4c144d18872cafa2339b2\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60b4c144d18872cafa2339b2\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<h4>\u0421\u0442\u043e\u043f \u0442\u043e\u0447\u043a\u0430 (Stop dot)<\/h4>\n<p>\u0412 <code>npm-quick-run<\/code> \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043b\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0441\u0438\u043c\u0432\u043e\u043b \u0442\u043e\u0447\u043a\u0438 <code>.<\/code> \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430, \u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u043b\u043e\u0432. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b <code>package.json<\/code>:<\/p>\n<pre><code class=\"json\">{   \"scripts\": {     \"cypress\": \"cypress -help\",     \"cypress:open\": \"cypress open\",     \"cypress:run\": \"cypress run\",     \"cypress:run:record\": \"cypress run --record\"   } }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 &#171;cypress&#187; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u0441 &#171;.&#187; \u0432 \u043a\u043e\u043d\u0446\u0435:<\/p>\n<pre><code class=\"json\"># same as \"npm run cypress\" $ nr c. # finds the script with a single word starting with \"c\"  # same as \"npm run cypress:open\" $ nr c-o.  # same as \"npm run cypress:run\" $ nr c-r.  # these commands are equivalent $ npm run cypress:run:record $ yarn cypress:run:record $ nr c-r-r $ nr c-r-r.<\/code><\/pre>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u044f \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u0438\u043c\u0432\u043e\u043b\u044b <code>-<\/code> \u0438 <code>.<\/code> \u0434\u043b\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432 \u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u043c\u043e\u0433\u0443 \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0445 \u0431\u0435\u0437 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0438 Shift.<\/p>\n<hr>\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/NbQi\/\"><strong>&#171;Node.js Developer&#187;<\/strong><\/a>. \u0412\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u0435\u043c\u043e-\u0443\u0440\u043e\u043a <a href=\"https:\/\/otus.pw\/mP0Z\/\">\u00abTypeScript \u0432 Node.js \u0434\u043b\u044f server-side \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439\u00bb<\/a>. \u041d\u0430 \u0437\u0430\u043d\u044f\u0442\u0438\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c:<br \/>&#8212; \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c TypeScript \u0432 Node.js;<br \/>&#8212; \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 ts-node \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438;<br \/>&#8212; \u0434\u0432\u0438\u0436\u043e\u043a deno \u2014 \u043d\u043e\u0432\u044b\u0439 Node.js \u0441 TypeScript.  <\/p>\n<\/blockquote>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/560176\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/560176\/<\/a><br \/><\/br><\/br><\/p>\n<\/blockquote>\n<\/hr>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-324045","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/324045","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=324045"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/324045\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=324045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=324045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=324045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}