Skip to content

Commit

Permalink
Merge pull request #601 from thewtex/bump-vite-example
Browse files Browse the repository at this point in the history
bump vite example
  • Loading branch information
thewtex authored Jul 10, 2022
2 parents f09e381 + 445c387 commit 1c1f611
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 102 deletions.
36 changes: 14 additions & 22 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,34 +167,26 @@ jobs:
./cypress/run-docker-firefox.sh
test-vite-example-firefox:
name: Vite, Firefox
test-vite-example:
name: Vite Example
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ./examples/Vite

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2
- name: Test Vite Example on Chrome
uses: cypress-io/github-action@v4
with:
node-version: '16'

- name: Install
run: |
npm install
- name: Build
run: |
npm run build
working-directory: ./examples/Vite
browser: chrome
start: npm start

- name: Test Firefox
run: |
# Allow writing test output in the Docker image
sudo chmod -R 777 cypress
# To debug locally, run `./cypress/run-docker-firefox.sh -d`
./cypress/run-docker-firefox.sh
- name: Test Vite Example on Firefox
uses: cypress-io/github-action@v4
with:
working-directory: ./examples/Vite
browser: firefox
start: npm start

test-debugging-example:
name: Debugging
Expand Down
1 change: 0 additions & 1 deletion examples/Vite/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
cypress/support
cypress/videos
cypress/screenshots
12 changes: 12 additions & 0 deletions examples/Vite/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
e2e: {
defaultCommandTimeout: 8000,
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
})
1 change: 0 additions & 1 deletion examples/Vite/cypress.json

This file was deleted.

File renamed without changes.
22 changes: 0 additions & 22 deletions examples/Vite/cypress/plugins/index.js

This file was deleted.

25 changes: 25 additions & 0 deletions examples/Vite/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions examples/Vite/cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
96 changes: 48 additions & 48 deletions examples/Vite/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions examples/Vite/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "itk-vite-example",
"version": "1.0.0",
"version": "1.0.1",
"description": "This example demonstrates how to use itk-wasm in a Rollup project that targets the browser.",
"main": "index.js",
"scripts": {
"start": "vite --port 8080",
"build": "vite build",
"start:production": "vite preview --port 8080",
"cypress:open": "npx cypress open",
"cypress:run": "npx cypress run --config defaultCommandTimeout=8000",
"cypress:runChrome": "npx cypress run --config defaultCommandTimeout=8000 --browser chrome",
"cypress:runFirefox": "npx cypress run --config defaultCommandTimeout=8000 --browser firefox",
"cypress:run": "npx cypress run",
"cypress:runChrome": "npx cypress run --browser chrome",
"cypress:runFirefox": "npx cypress run --browser firefox",
"test:debug": "start-server-and-test start http-get://localhost:8080 cypress:open",
"test": "start-server-and-test start:production http-get://localhost:8080 cypress:run",
"test:chrome": "start-server-and-test start:production http-get://localhost:8080 cypress:runChrome",
Expand All @@ -33,12 +33,12 @@
"homepage": "https://github.com/InsightSoftwareConsortium/itk-wasm#readme",
"dependencies": {
"curry": "^1.2.0",
"itk-image-io": "^1.0.0-b.6",
"itk-mesh-io": "^1.0.0-b.6",
"itk-wasm": "^1.0.0-b.6"
"itk-image-io": "^1.0.0-b.18",
"itk-mesh-io": "^1.0.0-b.18",
"itk-wasm": "^1.0.0-b.18"
},
"devDependencies": {
"cypress": "^9.5.2",
"cypress": "^10.3.0",
"rollup-plugin-copy": "^3.4.0",
"start-server-and-test": "^1.14.0",
"vite": "^2.8.6"
Expand Down

0 comments on commit 1c1f611

Please sign in to comment.