11import * as assert from 'assert'
2- import * as utils from '../support/utils'
2+ import * as utils from '../../../shared/ support/utils'
33import { randomBytes } from 'crypto'
4- import { BundleServerWorld , User } from '../support/world'
4+ import { EndToEndBundleServerWorld , User } from '../support/world'
55import { Given , When , Then } from '@cucumber/cucumber'
66
77/**
@@ -10,7 +10,7 @@ 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 : EndToEndBundleServerWorld , commitNum : number , branch : string ) {
1414 const clonedRepo = this . getRepoAtBranch ( User . Another , branch )
1515
1616 for ( let i = 0 ; i < commitNum ; i ++ ) {
@@ -22,7 +22,7 @@ Given('another user pushed {int} commits to {string}', async function (this: Bun
2222} )
2323
2424Given ( 'another user removed {int} commits and added {int} commits to {string}' ,
25- async function ( this : BundleServerWorld , removeCommits : number , addCommits : number , branch : string ) {
25+ async function ( this : EndToEndBundleServerWorld , removeCommits : number , addCommits : number , branch : string ) {
2626 const clonedRepo = this . getRepoAtBranch ( User . Another , branch )
2727
2828 // First, reset
@@ -40,33 +40,33 @@ Given('another user removed {int} commits and added {int} commits to {string}',
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 : EndToEndBundleServerWorld ) {
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 : EndToEndBundleServerWorld ) {
5050 this . cloneRepositoryFor ( User . Me , this . bundleServer . bundleUri ( ) )
5151} )
5252
53- When ( 'another developer clones from the remote repo without a bundle URI' , async function ( this : BundleServerWorld ) {
53+ When ( 'another developer clones from the remote repo without a bundle URI' , async function ( this : EndToEndBundleServerWorld ) {
5454 this . cloneRepositoryFor ( User . Another )
5555} )
5656
57- When ( 'I fetch from the remote' , async function ( this : BundleServerWorld ) {
57+ When ( 'I fetch from the remote' , async function ( this : EndToEndBundleServerWorld ) {
5858 const clonedRepo = this . getRepo ( User . Me )
5959 utils . assertStatus ( 0 , clonedRepo . runGit ( "fetch" , "origin" ) )
6060} )
6161
62- Then ( 'bundles are downloaded and used' , async function ( this : BundleServerWorld ) {
62+ Then ( 'bundles are downloaded and used' , async function ( this : EndToEndBundleServerWorld ) {
6363 const clonedRepo = this . getRepo ( User . Me )
6464
6565 // Verify the clone executed as-expected
6666 utils . assertStatus ( 0 , clonedRepo . cloneResult , "git clone failed" )
6767
6868 // Ensure warning wasn't thrown
69- clonedRepo . cloneResult . stderr . toString ( ) . split ( "\n" ) . forEach ( function ( line ) {
69+ clonedRepo . cloneResult . stderr . toString ( ) . split ( "\n" ) . forEach ( function ( line : string ) {
7070 if ( line . startsWith ( "warning: failed to download bundle from URI" ) ) {
7171 assert . fail ( line )
7272 }
@@ -81,13 +81,13 @@ Then('bundles are downloaded and used', async function (this: BundleServerWorld)
8181 result = clonedRepo . runGit ( "for-each-ref" , "--format=%(refname)" , "refs/bundles/*" )
8282 utils . assertStatus ( 0 , result , "git for-each-ref failed" )
8383
84- const bundleRefs = result . stdout . toString ( ) . split ( "\n" ) . filter ( function ( line ) {
84+ const bundleRefs = result . stdout . toString ( ) . split ( "\n" ) . filter ( function ( line : string ) {
8585 return line . trim ( ) != ""
8686 } )
8787 assert . strict ( bundleRefs . length > 0 , "No bundle refs found in the repo" )
8888} )
8989
90- Then ( 'I am up-to-date with {string}' , async function ( this : BundleServerWorld , branch : string ) {
90+ Then ( 'I am up-to-date with {string}' , async function ( this : EndToEndBundleServerWorld , branch : string ) {
9191 const clonedRepo = this . getRepo ( User . Me )
9292 const result = clonedRepo . runGit ( "rev-parse" , `refs/remotes/origin/${ branch } ` )
9393 utils . assertStatus ( 0 , result )
@@ -97,7 +97,7 @@ Then('I am up-to-date with {string}', async function (this: BundleServerWorld, b
9797} )
9898
9999Then ( 'my repo\'s bundles {boolean} up-to-date with {string}' ,
100- async function ( this : BundleServerWorld , expectedUpToDate : boolean , branch : string ) {
100+ async function ( this : EndToEndBundleServerWorld , expectedUpToDate : boolean , branch : string ) {
101101 const clonedRepo = this . getRepo ( User . Me )
102102 const result = clonedRepo . runGit ( "rev-parse" , `refs/bundles/${ branch } ` )
103103 utils . assertStatus ( 0 , result )
@@ -112,7 +112,7 @@ Then('my repo\'s bundles {boolean} up-to-date with {string}',
112112 }
113113)
114114
115- Then ( 'I compare the clone execution times' , async function ( this : BundleServerWorld ) {
115+ Then ( 'I compare the clone execution times' , async function ( this : EndToEndBundleServerWorld ) {
116116 const myClone = this . getRepo ( User . Me )
117117 const otherClone = this . getRepo ( User . Another )
118118
0 commit comments