Skip to content

Commit

Permalink
chore: remove cypress folder in packages
Browse files Browse the repository at this point in the history
  • Loading branch information
2eha0 committed Jul 31, 2024
1 parent 3d1eeea commit 827a61a
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 271 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ coverage
_public
bundle-analyzer

**/cypress/videos/
**/cypress/screenshots/
**/cypress/downloads/
cypress/videos/
cypress/screenshots/
cypress/downloads/

# Editor directories and files
.vscode/*
Expand Down
8 changes: 8 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,11 @@ Cypress.Commands.add('mount', (component, options = {}) => {

return mount(component, options)
})

Cypress.Commands.add('assertValueCopiedToClipboard', value => {
cy.window().then(win => {
win.navigator.clipboard.readText().then(text => {
expect(text).to.eq(value)
})
})
})
2 changes: 2 additions & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ declare namespace Cypress {
* @param {any} options Options or props
*/
mount(component: any, options?: any): Chainable

assertValueCopiedToClipboard(value: string): Chainable
}
}
9 changes: 8 additions & 1 deletion packages/core/expressions/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ export default defineConfig({
framework: 'vue',
bundler: 'vite',
},
supportFile: './cypress/support/index.ts',
supportFile: '../../../cypress/support/index.ts',
indexHtmlFile: '../../../cypress/support/component-index.html',
},
downloadsFolder: '../../../cypress/downloads',
fixturesFolder: '../../../cypress/fixtures',
videosFolder: '../../../cypress/videos',
supportFolder: '../../../cypress/support',
screenshotsFolder: '../../../cypress/screenshots',
fileServerFolder: '../../../cypress',
})
5 changes: 0 additions & 5 deletions packages/core/expressions/cypress/fixtures/example.json

This file was deleted.

36 changes: 0 additions & 36 deletions packages/core/expressions/cypress/support/commands.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/core/expressions/cypress/support/component-index.html

This file was deleted.

32 changes: 0 additions & 32 deletions packages/core/expressions/cypress/support/component.ts

This file was deleted.

27 changes: 0 additions & 27 deletions packages/core/expressions/cypress/support/index.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/core/expressions/cypress/support/index.ts

This file was deleted.

8 changes: 4 additions & 4 deletions packages/core/expressions/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const config = mergeConfig(sharedViteConfig, defineConfig({
topLevelAwait({
promiseExportName: 'asyncInit',
}),
// We don't need this plugin to bundle the library. Only for sandbox previews and test.
// See: https://github.com/vdesjs/vite-plugin-monaco-editor/issues/21
...process.env.NODE_ENV === 'development'
// This plugin is only used in the sandbox & testing environment
// It generates extra files in dist folder whitch are not need in library build
...((process.env.USE_SANDBOX || process.env.BABEL_ENV === 'cypress')
? [((monacoEditorPlugin as any).default as typeof monacoEditorPlugin)({})]
: [],
: []),
],
}))

Expand Down
17 changes: 8 additions & 9 deletions packages/entities/entities-routes/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ export default defineConfig({
framework: 'vue',
bundler: 'vite',
},
supportFile: './cypress/support/index.ts',
specPattern: '**/src/**/*.cy.ts',
excludeSpecPattern: '**/__template__/**/*.cy.ts',
supportFile: '../../../cypress/support/index.ts',
indexHtmlFile: '../../../cypress/support/component-index.html',
},
includeShadowDom: true,
fixturesFolder: 'cypress/fixtures',
retries: {
runMode: 1,
},
trashAssetsBeforeRuns: false,
downloadsFolder: '../../../cypress/downloads',
fixturesFolder: '../../../cypress/fixtures',
videosFolder: '../../../cypress/videos',
supportFolder: '../../../cypress/support',
screenshotsFolder: '../../../cypress/screenshots',
fileServerFolder: '../../../cypress',
})

This file was deleted.

48 changes: 0 additions & 48 deletions packages/entities/entities-routes/cypress/support/commands.ts

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions packages/entities/entities-routes/cypress/support/component.ts

This file was deleted.

25 changes: 0 additions & 25 deletions packages/entities/entities-routes/cypress/support/index.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/entities/entities-routes/cypress/support/index.ts

This file was deleted.

27 changes: 16 additions & 11 deletions packages/entities/entities-routes/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,23 @@ const config = mergeConfig(sharedViteConfig, defineConfig({
],
},
},
...process.env.USE_SANDBOX && {
server: {
proxy: {
// Add the API proxies to inject the Authorization header
...getApiProxies(),
...(process.env.USE_SANDBOX
? {
server: {
proxy: {
// Add the API proxies to inject the Authorization header
...getApiProxies(),
},
},
},
plugins: [
// See: https://github.com/vdesjs/vite-plugin-monaco-editor/issues/21
((monacoEditorPlugin as any).default as typeof monacoEditorPlugin)({}),
],
},
}
: {}),
plugins: [
// This plugin is only used in the sandbox & testing environment
// It generates extra files in dist folder whitch are not need in library build
...((process.env.USE_SANDBOX || process.env.BABEL_ENV === 'cypress')
? [((monacoEditorPlugin as any).default as typeof monacoEditorPlugin)({})]
: []),
],
}))

// If we are trying to preview a build of the local `package/entities-routes/sandbox` directory,
Expand Down

0 comments on commit 827a61a

Please sign in to comment.