Skip to content

Commit a3debfc

Browse files
committed
chore(test): Modernize Cypress config
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 5d3d25c commit a3debfc

5 files changed

Lines changed: 22 additions & 253 deletions

File tree

cypress.config.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
configureNextcloud,
3-
startNextcloud,
4-
stopNextcloud,
5-
waitOnNextcloud,
6-
} from './cypress/dockerNode'
1+
import { configureNextcloud, startNextcloud, stopNextcloud, waitOnNextcloud } from '@nextcloud/cypress/docker'
72
// eslint-disable-next-line n/no-extraneous-import
83
import { defineConfig } from 'cypress'
94

@@ -76,17 +71,12 @@ export default defineConfig({
7671

7772
// Before the browser launches
7873
// starting Nextcloud testing container
79-
return startNextcloud(process.env.BRANCH)
80-
.then((ip) => {
81-
// Setting container's IP as base Url
82-
config.baseUrl = `http://${ip}/index.php`
83-
return ip
84-
})
85-
.then(waitOnNextcloud)
86-
.then(() => configureNextcloud(process.env.BRANCH))
87-
.then(() => {
88-
return config
89-
})
74+
const ip = await startNextcloud(process.env.BRANCH || 'master')
75+
// Setting container's IP as base Url
76+
config.baseUrl = `http://${ip}/index.php`
77+
await waitOnNextcloud(ip)
78+
await configureNextcloud(['viewer'])
79+
return config
9080
},
9181
},
9282

cypress/docker-compose.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

cypress/dockerNode.ts

Lines changed: 0 additions & 208 deletions
This file was deleted.

cypress/tsconfig.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"extends": "../tsconfig.json",
3-
"include": ["./**/*.ts"],
3+
"include": [
4+
"../*.ts",
5+
"."
6+
],
47
"compilerOptions": {
8+
"rootDir": "..",
59
"types": [
6-
"@testing-library/cypress",
710
"cypress",
811
"dockerode",
912
"node",
1013
"@testing-library/cypress"
1114
]
1215
}
13-
}
16+
}

tsconfig.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"extends": "@vue/tsconfig/tsconfig.json",
3-
"include": ["./src/**/*.ts", "./src/**/*.vue"],
3+
"include": [
4+
"./src"
5+
],
46
"compilerOptions": {
5-
"allowJs": true,
6-
"allowSyntheticDefaultImports": true,
7-
"moduleResolution": "Bundler",
7+
"lib": [
8+
"DOM",
9+
"ES2015"
10+
],
11+
"rootDir": "src",
812
"noImplicitAny": false,
9-
"outDir": "./js/",
10-
"strict": true
1113
},
1214
"vueCompilerOptions": {
1315
"target": 2.7
1416
}
15-
}
17+
}

0 commit comments

Comments
 (0)