Skip to content

Commit 2969732

Browse files
committed
integration tests: testing infrastructure
Add the initial infrastructure for integration tests, following the pattern set with end-to-end tests in [1]. This includes Cucumber configuration and basic support classes. 1: bc8df92 Signed-off-by: Lessley Dennington <[email protected]>
1 parent 6125a0e commit 2969732

File tree

4 files changed

+47
-2
lines changed

4 files changed

+47
-2
lines changed

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040

4141
// Cucumber settings
4242
"cucumber.features": [
43-
"test/e2e/features/**/*.feature",
43+
"test/**/features/**/*.feature",
4444
],
4545
"cucumber.glue": [
46-
"test/e2e/features/**/*.ts"
46+
"test/**/features/**/*.ts",
4747
],
4848
}

test/integration/cucumber.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const common = {
2+
requireModule: ['ts-node/register'],
3+
require: [`${__dirname}/features/**/*.ts`],
4+
publishQuiet: true,
5+
format: ['progress'],
6+
formatOptions: {
7+
snippetInterface: 'async-await'
8+
},
9+
worldParameters: {
10+
bundleServerCommand: `${__dirname}/../../bin/git-bundle-server`,
11+
bundleWebServerCommand: `${__dirname}/../../bin/git-bundle-web-server`,
12+
trashDirectoryBase: `${__dirname}/../../_test/integration`
13+
}
14+
}
15+
16+
module.exports = {
17+
default: {
18+
...common,
19+
},
20+
ci: {
21+
...common,
22+
tags: 'not @daemon',
23+
},
24+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as path from 'path'
2+
3+
export function absPath(pathParam: string): string {
4+
// Convert a given path (either relative to 'test/integration/' or absolute) to an
5+
// absolute path
6+
if (!path.isAbsolute(pathParam)) {
7+
return path.resolve(__dirname, "../..", pathParam)
8+
} else {
9+
return pathParam
10+
}
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { setWorldConstructor, World, IWorldOptions } from '@cucumber/cucumber'
2+
import * as child_process from 'child_process'
3+
4+
interface BundleServerParameters {
5+
bundleServerCommand: string
6+
}
7+
8+
export class BundleServerWorld extends World<BundleServerParameters> { }
9+
10+
setWorldConstructor(BundleServerWorld)

0 commit comments

Comments
 (0)