Skip to content

Commit 2830448

Browse files
committed
chore: upgrade chode
1 parent ea04217 commit 2830448

File tree

7 files changed

+85
-105
lines changed

7 files changed

+85
-105
lines changed

.eslintcache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"/Users/jerome/Documents/projects/nuxt-netlify-functions-example/components/Example4.vue":"1"},{"size":1443,"mtime":1633421030647,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1shgw9g","/Users/jerome/Documents/projects/nuxt-netlify-functions-example/components/Example4.vue",[]]

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = {
33
env: {
44
browser: true,
55
node: true,
6+
'cypress/globals': true,
67
},
78
parserOptions: {
89
parser: 'babel-eslint',
@@ -12,7 +13,7 @@ module.exports = {
1213
'plugin:prettier/recommended',
1314
'plugin:nuxt/recommended',
1415
],
15-
plugins: ['prettier'],
16+
plugins: ['prettier', 'cypress'],
1617
// add your custom rules here
1718
rules: {
1819
'import/no-named-as-default': 'off',

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ netlify-lambda-build
1616
.env
1717

1818
.DS_store
19+
20+
.netlify

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ $ nvm use
2626
# Install dependencies
2727
$ yarn
2828

29-
# Build Nuxt app
30-
$ yarn build
31-
3229
# Serve Nuxt app and Netlify functions at localhost:8888
3330
$ netlify dev
3431

nuxt.config.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,4 @@ export default {
4949
/*
5050
** Build configuration
5151
*/
52-
build: {
53-
/*
54-
** You can extend webpack config here
55-
*/
56-
extend(config, ctx) {},
57-
},
5852
}

test/integration/app.spec.js

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
const name = 'Marco'
2-
3-
describe('Example 1', () => {
4-
it('Shows Hello, World', () => {
5-
cy.visit('/')
6-
cy.get('[data-cy=btn-hello-world]').click()
7-
cy.contains('Hello, World')
8-
})
9-
})
10-
11-
describe('Example 2', () => {
12-
beforeEach(() => {
13-
cy.visit('/')
14-
})
15-
16-
it('Defaults to "Hello, World"', () => {
17-
cy.get('[data-cy=btn-hello-name]').click()
18-
cy.contains('Hello, World')
19-
})
20-
21-
it(`Shows "Hello, ${name}"`, () => {
22-
cy.get('[data-cy=input-hello-name]').type(name)
23-
cy.get('[data-cy=btn-hello-name]').click()
24-
cy.contains(`Hello, ${name}`)
25-
})
26-
})
27-
28-
describe('Example 3', () => {
29-
beforeEach(() => {
30-
cy.visit('/')
31-
cy.server()
32-
cy.route('POST', '/.netlify/functions/hello-name-post').as('postName')
33-
cy.route('GET', '/.netlify/functions/hello-name-post**').as('getName')
34-
})
35-
36-
it('Defaults to "Hello, World"', () => {
37-
cy.get('[data-cy=btn-hello-name-post]').click()
38-
cy.contains('Hello, World')
39-
cy.wait('@postName').its('method').should('eq', 'POST')
40-
})
41-
42-
it(`Shows "Hello, ${name}"`, () => {
43-
cy.get('[data-cy=input-hello-name-post]').type(name)
44-
cy.get('[data-cy=btn-hello-name-post]').click()
45-
cy.contains(`Hello, ${name}`)
46-
cy.wait('@postName').its('method').should('eq', 'POST')
47-
})
48-
49-
it(`Throws error 405 Method Not Allowed`, () => {
50-
cy.get('[data-cy=btn-hello-name-post-error]').click()
51-
cy.wait('@getName').then((xhr) => {
52-
expect(xhr.status).to.equal(405)
53-
expect(xhr.method).to.equal('GET')
54-
})
55-
cy.contains(`405`)
56-
})
57-
})
58-
59-
describe('Example 4', () => {
60-
beforeEach(() => {
61-
cy.visit('/')
62-
cy.server()
63-
cy.route('GET', '/.netlify/functions/random-cat**').as('getName')
64-
})
65-
66-
it('Defaults to Meow', () => {
67-
cy.get('[data-cy=btn-random-cat]').click()
68-
cy.wait('@getName').its('response.body').should('include', 'Meow')
69-
cy.contains('Hello, World')
70-
cy.get('[data-cy=img-random-cat]').should('be.visible')
71-
})
72-
73-
it(`Shows "Hello, ${name}"`, () => {
74-
cy.get('[data-cy=input-random-cat]').type(name)
75-
cy.get('[data-cy=btn-random-cat]').click()
76-
cy.wait('@getName').its('response.body').should('include', name)
77-
cy.get('[data-cy=img-random-cat]').should('be.visible')
78-
})
79-
})
1+
const name = 'Marco'
2+
3+
describe('Example 1', () => {
4+
it('Shows Hello, World', () => {
5+
cy.visit('/')
6+
cy.get('[data-cy=btn-hello-world]').click()
7+
cy.contains('Hello, World')
8+
})
9+
})
10+
11+
describe('Example 2', () => {
12+
beforeEach(() => {
13+
cy.visit('/')
14+
})
15+
16+
it('Defaults to "Hello, World"', () => {
17+
cy.get('[data-cy=btn-hello-name]').click()
18+
cy.contains('Hello, World')
19+
})
20+
21+
it(`Shows "Hello, ${name}"`, () => {
22+
cy.get('[data-cy=input-hello-name]').type(name)
23+
cy.get('[data-cy=btn-hello-name]').click()
24+
cy.contains(`Hello, ${name}`)
25+
})
26+
})
27+
28+
describe('Example 3', () => {
29+
beforeEach(() => {
30+
cy.visit('/')
31+
cy.server()
32+
cy.route('POST', '/.netlify/functions/hello-name-post').as('postName')
33+
cy.route('GET', '/.netlify/functions/hello-name-post**').as('getName')
34+
})
35+
36+
it('Defaults to "Hello, World"', () => {
37+
cy.get('[data-cy=btn-hello-name-post]').click()
38+
cy.contains('Hello, World')
39+
cy.wait('@postName').its('method').should('eq', 'POST')
40+
})
41+
42+
it(`Shows "Hello, ${name}"`, () => {
43+
cy.get('[data-cy=input-hello-name-post]').type(name)
44+
cy.get('[data-cy=btn-hello-name-post]').click()
45+
cy.contains(`Hello, ${name}`)
46+
cy.wait('@postName').its('method').should('eq', 'POST')
47+
})
48+
49+
it(`Throws error 405 Method Not Allowed`, () => {
50+
cy.get('[data-cy=btn-hello-name-post-error]').click()
51+
cy.wait('@getName').then((xhr) => {
52+
expect(xhr.status).to.equal(405)
53+
expect(xhr.method).to.equal('GET')
54+
})
55+
cy.contains(`405`)
56+
})
57+
})
58+
59+
describe('Example 4', () => {
60+
beforeEach(() => {
61+
cy.visit('/')
62+
cy.server()
63+
cy.route('GET', '/.netlify/functions/random-cat**').as('getName')
64+
})
65+
66+
it('Defaults to Meow', () => {
67+
cy.get('[data-cy=btn-random-cat]').click()
68+
cy.wait('@getName').its('response.body').should('include', 'Meow')
69+
cy.contains('Hello, World')
70+
cy.get('[data-cy=img-random-cat]').should('be.visible')
71+
})
72+
73+
it(`Shows "Hello, ${name}"`, () => {
74+
cy.get('[data-cy=input-random-cat]').type(name)
75+
cy.get('[data-cy=btn-random-cat]').click()
76+
cy.wait('@getName').its('response.body').should('include', name)
77+
cy.get('[data-cy=img-random-cat]').should('be.visible')
78+
})
79+
})

yarn.lock

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6299,13 +6299,6 @@ fetch-blob@^2.1.1:
62996299
resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-2.1.2.tgz#a7805db1361bd44c1ef62bb57fb5fe8ea173ef3c"
63006300
integrity sha512-YKqtUDwqLyfyMnmbw8XD6Q8j9i/HggKtPEI+pZ1+8bvheBu78biSmNaXWusx1TauGqtUUGx/cBb1mKdq2rLYow==
63016301

6302-
fetch-blob@^3.1.2:
6303-
version "3.1.2"
6304-
resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.1.2.tgz#6bc438675f3851ecea51758ac91f6a1cd1bacabd"
6305-
integrity sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==
6306-
dependencies:
6307-
web-streams-polyfill "^3.0.3"
6308-
63096302
fetch-node-website@^5.0.3:
63106303
version "5.0.3"
63116304
resolved "https://registry.yarnpkg.com/fetch-node-website/-/fetch-node-website-5.0.3.tgz#eaafe4beca7b34b80de6f703b76bcac06eb26ec9"
@@ -9483,14 +9476,6 @@ node-fetch@^2.3.0, node-fetch@^2.6.0, node-fetch@^2.6.1:
94839476
dependencies:
94849477
whatwg-url "^5.0.0"
94859478

9486-
node-fetch@^3.0.0:
9487-
version "3.0.0"
9488-
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.0.0.tgz#79da7146a520036f2c5f644e4a26095f17e411ea"
9489-
integrity sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==
9490-
dependencies:
9491-
data-uri-to-buffer "^3.0.1"
9492-
fetch-blob "^3.1.2"
9493-
94949479
node-html-parser@^3.2.0:
94959480
version "3.3.6"
94969481
resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-3.3.6.tgz#fdbb3ba16d1252d7197ec39f0260d9c10ef33590"
@@ -13660,7 +13645,7 @@ wcwidth@^1.0.1:
1366013645
dependencies:
1366113646
defaults "^1.0.3"
1366213647

13663-
web-streams-polyfill@^3.0.1, web-streams-polyfill@^3.0.3:
13648+
web-streams-polyfill@^3.0.1:
1366413649
version "3.1.1"
1366513650
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz#1516f2d4ea8f1bdbfed15eb65cb2df87098c8364"
1366613651
integrity sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q==

0 commit comments

Comments
 (0)