mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
v4 (#1099)
* feat: update action runtime to node 16 * feat: allow add-paths to resolve to no changes * docs: update readme * chore: update package lock * chore: bump dependency * ci: add dependabot workflow * docs: update action versions
This commit is contained in:
parent
0e8dfbd57d
commit
d6d5519d05
15 changed files with 291 additions and 185 deletions
|
@ -11,8 +11,8 @@ import {v4 as uuidv4} from 'uuid'
|
|||
const REPO_PATH = '/git/local/test-base'
|
||||
const REMOTE_NAME = 'origin'
|
||||
|
||||
const TRACKED_FILE = 'tracked-file.txt'
|
||||
const UNTRACKED_FILE = 'untracked-file.txt'
|
||||
const TRACKED_FILE = 'a/tracked-file.txt'
|
||||
const UNTRACKED_FILE = 'b/untracked-file.txt'
|
||||
|
||||
const DEFAULT_BRANCH = 'tests/master'
|
||||
const NOT_BASE_BRANCH = 'tests/branch-that-is-not-the-base'
|
||||
|
@ -25,12 +25,14 @@ const BASE = DEFAULT_BRANCH
|
|||
const FORK_REMOTE_URL = 'git://127.0.0.1/test-fork.git'
|
||||
const FORK_REMOTE_NAME = 'fork'
|
||||
|
||||
const ADD_PATHS = ['-A']
|
||||
const ADD_PATHS_WILDCARD = ['*.txt']
|
||||
const ADD_PATHS_DEFAULT = []
|
||||
const ADD_PATHS_MULTI = ['a', 'b']
|
||||
const ADD_PATHS_WILDCARD = ['a/*.txt', 'b/*.txt']
|
||||
|
||||
async function createFile(filename: string, content?: string): Promise<string> {
|
||||
const _content = content ? content : uuidv4()
|
||||
const filepath = path.join(REPO_PATH, filename)
|
||||
await fs.promises.mkdir(path.dirname(filepath), {recursive: true})
|
||||
await fs.promises.writeFile(filepath, _content, {encoding: 'utf8'})
|
||||
return _content
|
||||
}
|
||||
|
@ -224,7 +226,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('none')
|
||||
expect(await gitLogMatches([INIT_COMMIT_MESSAGE])).toBeTruthy()
|
||||
|
@ -241,7 +243,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(trackedContent)
|
||||
|
@ -269,7 +271,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -290,7 +292,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(UNTRACKED_FILE)).toEqual(untrackedContent)
|
||||
|
@ -318,7 +320,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -341,7 +343,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -370,7 +372,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('not-updated')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -391,7 +393,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -428,7 +430,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -459,7 +461,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -487,7 +489,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeFalsy()
|
||||
|
@ -508,7 +510,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -548,7 +550,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeFalsy()
|
||||
|
@ -575,7 +577,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -618,7 +620,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeFalsy()
|
||||
|
@ -640,7 +642,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(commits.changes.tracked)
|
||||
|
@ -671,7 +673,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -697,7 +699,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -732,7 +734,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -760,7 +762,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -803,7 +805,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -830,7 +832,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
FORK_REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -859,7 +861,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
FORK_REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -881,7 +883,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
true,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -917,7 +919,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
true,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -935,9 +937,58 @@ describe('create-or-update-branch tests', () => {
|
|||
)
|
||||
})
|
||||
|
||||
it('tests create and update with wildcard add-paths', async () => {
|
||||
// The pull request branch will not be updated
|
||||
it('tests create and update with multiple add-paths', async () => {
|
||||
// Create tracked and untracked file changes
|
||||
const changes = await createChanges()
|
||||
const commitMessage = uuidv4()
|
||||
const result = await createOrUpdateBranch(
|
||||
git,
|
||||
commitMessage,
|
||||
'',
|
||||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS_MULTI
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
expect(await getFileContent(UNTRACKED_FILE)).toEqual(changes.untracked)
|
||||
expect(
|
||||
await gitLogMatches([commitMessage, INIT_COMMIT_MESSAGE])
|
||||
).toBeTruthy()
|
||||
|
||||
// Push pull request branch to remote
|
||||
await git.push([
|
||||
'--force-with-lease',
|
||||
REMOTE_NAME,
|
||||
`HEAD:refs/heads/${BRANCH}`
|
||||
])
|
||||
|
||||
await afterTest(false)
|
||||
await beforeTest()
|
||||
|
||||
// Create tracked and untracked file changes
|
||||
const _changes = await createChanges()
|
||||
const _commitMessage = uuidv4()
|
||||
const _result = await createOrUpdateBranch(
|
||||
git,
|
||||
_commitMessage,
|
||||
'',
|
||||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS_MULTI
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(_changes.tracked)
|
||||
expect(await getFileContent(UNTRACKED_FILE)).toEqual(_changes.untracked)
|
||||
expect(
|
||||
await gitLogMatches([_commitMessage, INIT_COMMIT_MESSAGE])
|
||||
).toBeTruthy()
|
||||
})
|
||||
|
||||
it('tests create and update with wildcard add-paths', async () => {
|
||||
// Create tracked and untracked file changes
|
||||
const changes = await createChanges()
|
||||
const commitMessage = uuidv4()
|
||||
|
@ -988,6 +1039,23 @@ describe('create-or-update-branch tests', () => {
|
|||
).toBeTruthy()
|
||||
})
|
||||
|
||||
it('tests create with add-paths resolving to no changes when other changes exist', async () => {
|
||||
// Create tracked and untracked file changes
|
||||
await createChanges()
|
||||
const commitMessage = uuidv4()
|
||||
const result = await createOrUpdateBranch(
|
||||
git,
|
||||
commitMessage,
|
||||
'',
|
||||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
['nonexistent/*']
|
||||
)
|
||||
expect(result.action).toEqual('none')
|
||||
expect(await gitLogMatches([INIT_COMMIT_MESSAGE])).toBeTruthy()
|
||||
})
|
||||
|
||||
// Working Base is Not Base (WBNB)
|
||||
|
||||
it('tests no changes resulting in no new branch being created (WBNB)', async () => {
|
||||
|
@ -1002,7 +1070,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('none')
|
||||
expect(await gitLogMatches([INIT_COMMIT_MESSAGE])).toBeTruthy()
|
||||
|
@ -1022,7 +1090,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(trackedContent)
|
||||
|
@ -1053,7 +1121,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -1077,7 +1145,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(UNTRACKED_FILE)).toEqual(untrackedContent)
|
||||
|
@ -1108,7 +1176,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -1134,7 +1202,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1166,7 +1234,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('not-updated')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1190,7 +1258,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1230,7 +1298,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -1264,7 +1332,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1295,7 +1363,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeFalsy()
|
||||
|
@ -1321,7 +1389,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1364,7 +1432,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeFalsy()
|
||||
|
@ -1394,7 +1462,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1440,7 +1508,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeFalsy()
|
||||
|
@ -1465,7 +1533,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(commits.changes.tracked)
|
||||
|
@ -1499,7 +1567,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -1528,7 +1596,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1566,7 +1634,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -1597,7 +1665,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1643,7 +1711,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -1673,7 +1741,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
FORK_REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1705,7 +1773,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
FORK_REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -1734,7 +1802,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1767,7 +1835,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -1793,7 +1861,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(result.action).toEqual('created')
|
||||
expect(await getFileContent(TRACKED_FILE)).toEqual(changes.tracked)
|
||||
|
@ -1834,7 +1902,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
expect(_result.action).toEqual('updated')
|
||||
expect(_result.hasDiffWithBase).toBeTruthy()
|
||||
|
@ -1866,7 +1934,7 @@ describe('create-or-update-branch tests', () => {
|
|||
BRANCH,
|
||||
REMOTE_NAME,
|
||||
false,
|
||||
ADD_PATHS
|
||||
ADD_PATHS_DEFAULT
|
||||
)
|
||||
// The action cannot successfully create the branch
|
||||
expect(result.action).toEqual('none')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue