Skip to content

Commit 6e7e67d

Browse files
authored
Merge pull request #590 from thewtex/umd-script
umd script
2 parents 2f60714 + 12928f9 commit 6e7e67d

9 files changed

Lines changed: 346 additions & 258 deletions

File tree

.github/workflows/examples.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,16 @@ jobs:
8787
test-umd-example:
8888
name: UMD
8989
runs-on: ubuntu-20.04
90-
container: cypress/browsers:node16.13.2-chrome97-ff96
9190

9291
steps:
93-
- uses: actions/checkout@v2
92+
- uses: actions/checkout@v3
9493

9594
- name: Test
96-
uses: cypress-io/github-action@v2
95+
uses: cypress-io/github-action@v4
9796
with:
9897
working-directory: ./examples/UMD
9998
browser: chrome
10099
start: npm start
101-
config: defaultCommandTimeout=8000
102100

103101
test-webpack-example-chrome-electron:
104102
name: Webpack, Chrome, Electron

examples/UMD/cypress.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
e2e: {
5+
defaultCommandTimeout: 8000,
6+
// We've imported your old cypress plugins here.
7+
// You may want to clean this up later by importing these.
8+
setupNodeEvents(on, config) {
9+
// implement node event listeners here
10+
},
11+
},
12+
})

examples/UMD/cypress.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************
3+
// This example commands.ts shows you how to
4+
// create various custom commands and overwrite
5+
// existing commands.
6+
//
7+
// For more comprehensive examples of custom
8+
// commands please read more here:
9+
// https://on.cypress.io/custom-commands
10+
// ***********************************************
11+
//
12+
//
13+
// -- This is a parent command --
14+
// Cypress.Commands.add('login', (email, password) => { ... })
15+
//
16+
//
17+
// -- This is a child command --
18+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19+
//
20+
//
21+
// -- This is a dual command --
22+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23+
//
24+
//
25+
// -- This will overwrite an existing command --
26+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27+
//
28+
// declare global {
29+
// namespace Cypress {
30+
// interface Chainable {
31+
// login(email: string, password: string): Chainable<void>
32+
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33+
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34+
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35+
// }
36+
// }
37+
// }
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// ***********************************************************
2+
// This example support/e2e.ts is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands'
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')

examples/UMD/dist/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<title>itk-wasm UMD Example</title>
55
<meta charset="UTF-8" />
66
<link rel="stylesheet" href="styles.css">
7-
<script src="./itk-wasm.js"></script>
7+
<script src="https://cdn.jsdelivr.net/npm/itk-wasm@1.0.0-b.16/dist/umd/itk-wasm.min.js"></script>
8+
89
<script src="https://cdn.jsdelivr.net/npm/itk-vtk-viewer@11.12.3/dist/itkVtkViewer.js"></script>
910
</head>
1011

0 commit comments

Comments
 (0)