Skip to content

Commit

Permalink
chore(#81): update nuxt config and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Sep 29, 2022
1 parent 5647f4d commit 13cf982
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: cd nuxt && npm run test:unit

- name: Generate dist 👨🏻‍💻
run: cd nuxt && NUXT_TELEMETRY_DISABLED=1 npm run generate
run: cd nuxt && NUXT_TARGET=static NUXT_TELEMETRY_DISABLED=1 npm run generate

- name: Run end-to-end tests 🧪
run: cd nuxt && npm run test:e2e
Expand Down
14 changes: 14 additions & 0 deletions nuxt/cypress/e2e/homepage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@
it('Homepage', () => {
// Given I visit the homepage.
cy.visit('/')

// Expect primary menu.
cy.get('div[blocks][name="primary_menu"]').should('exist')
.find('li').should('have.length', 1)
.first().should('contain.text', 'Home')

// Expect secondary menu.
cy.get('div[blocks][name="secondary_menu"]').should('exist')
.find('li').should('have.length', 1)
.first().should('contain.text', 'Log in')

// Expect empty frontpage in content block.
cy.get('div[blocks][name="content"]').should('exist')
.should('contain.text', 'No front page content has been created yet.')
})
2 changes: 1 addition & 1 deletion nuxt/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require('dotenv').config({ path: '../.env' })
const baseUrl = process.env.BASE_URL || ''

export default {
target: 'static',
target: process.env.NUXT_TARGET,

// Global page headers: https://go.nuxtjs.dev/config-head
head: {
Expand Down
4 changes: 3 additions & 1 deletion nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"lint:fix": "prettier --write --list-different . && npm run lint:js -- --fix && npm run lint:style -- --fix",
"lint:js": "eslint --ext .js,.vue --ignore-path ../.gitignore .",
"lint:style": "stylelint **/*.{vue,css} --ignore-path ../.gitignore",
"serve": "npm run generate && nuxt start",
"serve": "npm run build && npm start",
"start": "nuxt start",
"test": "npm run test:unit && npm run test:e2e",
"test:e2e": "start-server-and-test serve http://localhost:3000 'npx cypress run'",
"test:e2e:dev": "start-server-and-test dev http://localhost:3000 'npx cypress open'",
"test:e2e:open": "start-server-and-test serve http://localhost:3000 'npx cypress open'",
"test:unit": "jest"
},
"lint-staged": {
Expand Down

0 comments on commit 13cf982

Please sign in to comment.