Skip to content

Commit 3a93da2

Browse files
committed
e2e: formatting cleanup
Signed-off-by: Victoria Dye <[email protected]>
1 parent 426a966 commit 3a93da2

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

test/e2e/features/classes/remote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class RemoteRepo {
2727

2828
utils.assertStatus(0, utils.runGit("init", "--bare", this.root))
2929
if (mainBranch) {
30-
utils.assertStatus(0, utils.runGit("-C", this.root, "symbolic-ref", "HEAD", `refs/heads/${mainBranch}`))
30+
utils.assertStatus(0, utils.runGit("-C", this.root, "symbolic-ref", "HEAD", `refs/heads/${mainBranch}`))
3131
}
3232
}
3333
}

test/e2e/features/step_definitions/bundleServer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import * as utils from '../support/utils'
22
import { BundleServerWorld, } from '../support/world'
33
import { Given } from '@cucumber/cucumber'
44

5-
Given('the bundle web server was started at port {int}', async function(this: BundleServerWorld, port: number) {
5+
Given('the bundle web server was started at port {int}', async function (this: BundleServerWorld, port: number) {
66
this.bundleServer.startWebServer(port)
77
})
88

9-
Given('the bundle server has been initialized with the remote repo', async function(this: BundleServerWorld) {
9+
Given('the bundle server has been initialized with the remote repo', async function (this: BundleServerWorld) {
1010
if (this.remote === undefined) {
1111
throw new Error("Remote repository is not initialized")
1212
}
1313
utils.assertStatus(0, this.bundleServer.init(this.remote))
1414
})
1515

16-
Given('the bundle server was updated for the remote repo', async function(this: BundleServerWorld) {
16+
Given('the bundle server was updated for the remote repo', async function (this: BundleServerWorld) {
1717
utils.assertStatus(0, this.bundleServer.update())
1818
})

test/e2e/features/step_definitions/remote.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import * as path from 'path'
77
* Steps relating to the setup of the remote repository users will clone from.
88
*/
99

10-
Given('a remote repository {string}', async function(this: BundleServerWorld, url: string) {
10+
Given('a remote repository {string}', async function (this: BundleServerWorld, url: string) {
1111
this.remote = new RemoteRepo(false, url)
1212
})
1313

14-
Given('a new remote repository with main branch {string}', async function(this: BundleServerWorld, mainBranch: string) {
14+
Given('a new remote repository with main branch {string}', async function (this: BundleServerWorld, mainBranch: string) {
1515
this.remote = new RemoteRepo(true, path.join(this.trashDirectory, "server"), mainBranch)
1616
})

test/e2e/features/step_definitions/repository.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ import { Given, When, Then } from '@cucumber/cucumber'
1010
* test steps will live here.
1111
*/
1212

13-
Given('another user pushed {int} commits to {string}', async function(this: BundleServerWorld, commitNum: number, branch: string) {
13+
Given('another user pushed {int} commits to {string}', async function (this: BundleServerWorld, commitNum: number, branch: string) {
1414
const clonedRepo = this.getRepoAtBranch(User.Another, branch)
1515

1616
for (let i = 0; i < commitNum; i++) {
1717
utils.assertStatus(0, clonedRepo.runShell(`echo ${randomBytes(16).toString('hex')} >README.md`))
1818
utils.assertStatus(0, clonedRepo.runGit("add", "README.md"))
19-
utils.assertStatus(0, clonedRepo.runGit("commit", "-m", `test ${i+1}`))
19+
utils.assertStatus(0, clonedRepo.runGit("commit", "-m", `test ${i + 1}`))
2020
}
2121
utils.assertStatus(0, clonedRepo.runGit("push", "origin", branch))
2222
})
2323

2424
Given('another developer removed {int} commits and added {int} commits to {string}',
25-
async function(this: BundleServerWorld, removeCommits: number, addCommits: number, branch: string) {
25+
async function (this: BundleServerWorld, removeCommits: number, addCommits: number, branch: string) {
2626
const clonedRepo = this.getRepoAtBranch(User.Another, branch)
2727

2828
// First, reset
@@ -32,37 +32,37 @@ Given('another developer removed {int} commits and added {int} commits to {strin
3232
for (let i = 0; i < addCommits; i++) {
3333
utils.assertStatus(0, clonedRepo.runShell(`echo ${randomBytes(16).toString('hex')} >README.md`))
3434
utils.assertStatus(0, clonedRepo.runGit("add", "README.md"))
35-
utils.assertStatus(0, clonedRepo.runGit("commit", "-m", `test ${i+1}`))
35+
utils.assertStatus(0, clonedRepo.runGit("commit", "-m", `test ${i + 1}`))
3636
}
3737

3838
// Finally, force push
3939
utils.assertStatus(0, clonedRepo.runGit("push", "-f", "origin", branch))
4040
}
4141
)
4242

43-
Given('I cloned from the remote repo with a bundle URI', async function(this: BundleServerWorld) {
43+
Given('I cloned from the remote repo with a bundle URI', async function (this: BundleServerWorld) {
4444
const user = User.Me
4545
this.cloneRepositoryFor(user, this.bundleServer.bundleUri())
4646
utils.assertStatus(0, this.getRepo(user).cloneResult)
4747
})
4848

49-
When('I clone from the remote repo with a bundle URI', async function(this: BundleServerWorld) {
49+
When('I clone from the remote repo with a bundle URI', async function (this: BundleServerWorld) {
5050
this.cloneRepositoryFor(User.Me, this.bundleServer.bundleUri())
5151
})
5252

53-
When('I fetch from the remote', async function(this: BundleServerWorld) {
53+
When('I fetch from the remote', async function (this: BundleServerWorld) {
5454
const clonedRepo = this.getRepo(User.Me)
5555
utils.assertStatus(0, clonedRepo.runGit("fetch", "origin"))
5656
})
5757

58-
Then('bundles are downloaded and used', async function(this: BundleServerWorld) {
58+
Then('bundles are downloaded and used', async function (this: BundleServerWorld) {
5959
const clonedRepo = this.getRepo(User.Me)
6060

6161
// Verify the clone executed as-expected
6262
utils.assertStatus(0, clonedRepo.cloneResult, "git clone failed")
6363

6464
// Ensure warning wasn't thrown
65-
clonedRepo.cloneResult.stderr.toString().split("\n").forEach(function(line) {
65+
clonedRepo.cloneResult.stderr.toString().split("\n").forEach(function (line) {
6666
if (line.startsWith("warning: failed to download bundle from URI")) {
6767
assert.fail(line)
6868
}
@@ -78,13 +78,13 @@ Then('bundles are downloaded and used', async function(this: BundleServerWorld)
7878
assert.strictEqual(result.status, 0, "git for-each-ref failed")
7979

8080
const bundleRefRegex = new RegExp('^refs/bundles/.*$')
81-
const bundleRefs = result.stdout.toString().split("\n").filter(function(line) {
81+
const bundleRefs = result.stdout.toString().split("\n").filter(function (line) {
8282
return bundleRefRegex.test(line)
8383
})
8484
assert.strict(bundleRefs.length > 0, "No bundle refs found in the repo")
8585
})
8686

87-
Then('I am up-to-date with {string}', async function(this: BundleServerWorld, branch: string) {
87+
Then('I am up-to-date with {string}', async function (this: BundleServerWorld, branch: string) {
8888
const clonedRepo = this.getRepo(User.Me)
8989
const result = clonedRepo.runGit("rev-parse", `refs/remotes/origin/${branch}`)
9090
utils.assertStatus(0, result)
@@ -94,7 +94,7 @@ Then('I am up-to-date with {string}', async function(this: BundleServerWorld, br
9494
})
9595

9696
Then('my repo\'s bundles {boolean} up-to-date with {string}',
97-
async function(this: BundleServerWorld, expectedUpToDate: boolean, branch: string) {
97+
async function (this: BundleServerWorld, expectedUpToDate: boolean, branch: string) {
9898
const clonedRepo = this.getRepo(User.Me)
9999
const result = clonedRepo.runGit("rev-parse", `refs/bundles/${branch}`)
100100
utils.assertStatus(0, result)

test/e2e/features/support/world.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class BundleServerWorld extends World<BundleServerParameters> {
4040

4141
// Set up the bundle server
4242
this.bundleServer = new BundleServer(utils.absPath(this.parameters.bundleServerCommand),
43-
utils.absPath(this.parameters.bundleWebServerCommand))
43+
utils.absPath(this.parameters.bundleWebServerCommand))
4444
}
4545

4646
cloneRepositoryFor(user: User, bundleUri?: string): void {
@@ -49,7 +49,7 @@ export class BundleServerWorld extends World<BundleServerParameters> {
4949
}
5050

5151
const repoRoot = `${this.trashDirectory}/${User[user]}`
52-
this.repoMap.set(user, new ClonedRepository(this.remote, repoRoot, bundleUri))
52+
this.repoMap.set(user, new ClonedRepository(this.remote, repoRoot, bundleUri))
5353
}
5454

5555
getRepo(user: User): ClonedRepository {

0 commit comments

Comments
 (0)