-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import test from 'ava'; | ||
import { BitbucketProvider } from '../src/bitbucket-provider'; | ||
import { BitbucketProject } from '../src/bitbucket-project'; | ||
|
||
const REPOSITORY_URL = | ||
'https://arlac77@bitbucket.org/arlac77/sync-test-repository.git'; | ||
const REPOSITORY_NAME = 'arlac77/sync-test-repository'; | ||
|
||
const config = BitbucketProvider.optionsFromEnvironment(process.env); | ||
|
||
test.skip('create branch', async t => { | ||
const provider = new BitbucketProvider(config); | ||
const repository = await provider.repository(REPOSITORY_NAME); | ||
const newName = `test-${new Date().getTime()}`; | ||
const branch = await repository.createBranch(newName); | ||
|
||
t.is(branch.name, newName); | ||
|
||
//await branch.delete(); | ||
}); | ||
|
||
test.skip('delete branch', async t => { | ||
const provider = new BitbucketProvider(config); | ||
const repository = await provider.repository(REPOSITORY_NAME); | ||
|
||
const branches = await repository.branches(); | ||
|
||
for (const [name, branch] of branches.entries()) { | ||
if (name.match(/^test-/)) { | ||
await repository.deleteBranch(name); | ||
t.is(await repository.branch(name), undefined); | ||
} | ||
//console.log(`${name}: ${branch}`); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import test from 'ava'; | ||
import { BitbucketProvider } from '../src/bitbucket-provider'; | ||
import { BitbucketProject } from '../src/bitbucket-project'; | ||
|
||
const REPOSITORY_URL = | ||
'https://arlac77@bitbucket.org/arlac77/sync-test-repository.git'; | ||
const REPOSITORY_NAME = 'arlac77/sync-test-repository'; | ||
|
||
const config = BitbucketProvider.optionsFromEnvironment(process.env); | ||
|
||
test.skip('project by name', async t => { | ||
const provider = new BitbucketProvider(config); | ||
const project = await provider.project('decission-table'); | ||
|
||
t.is(project.name, 'decission-table'); | ||
}); |