Skip to content

Commit 56de022

Browse files
committed
feat: adds test webpack project with two app-config sources, one being static
1 parent e00ed7f commit 56de022

File tree

16 files changed

+210
-1
lines changed

16 files changed

+210
-1
lines changed

.github/workflows/cypress.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,12 @@ jobs:
5858
start: yarn serve -l 8992 ./dist
5959
env:
6060
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
61-
61+
- uses: cypress-io/github-action@v2
62+
with:
63+
group: app-config-two-app-config-sources
64+
working-directory: tests/webpack-projects/two-app-config-sources
65+
install: false
66+
record: true
67+
start: yarn serve -l 8993 ./dist
68+
env:
69+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
generate:
2+
- file: './src/@types/lcdev__app-config/index.d.ts'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type: object
2+
additionalProperties: false
3+
4+
required: []
5+
properties:
6+
bar:
7+
type: string
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bar: 'this is bar'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type: object
2+
additionalProperties: false
3+
4+
required: []
5+
properties:
6+
foo:
7+
type: string
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
foo: 'this is foo'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"projectId": "fm6zcy",
3+
"baseUrl": "http://localhost:8993"
4+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
describe('Config Loading', () => {
2+
it('should render both configurations', () => {
3+
cy.visit('/');
4+
5+
cy.get('body').should('contain', `{\n "foo": "this is foo"\n}`);
6+
cy.get('body').should('contain', `{\n "bar": "this is bar"\n}`);
7+
});
8+
});
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module.exports = (on, config) => {
2+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
//
11+
//
12+
// -- This is a parent command --
13+
// Cypress.Commands.add("login", (email, password) => { ... })
14+
//
15+
//
16+
// -- This is a child command --
17+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18+
//
19+
//
20+
// -- This is a dual command --
21+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22+
//
23+
//
24+
// -- This will overwrite an existing command --
25+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

0 commit comments

Comments
 (0)