Compare commits
27 Commits
main
...
vmjoseph/t
Author | SHA1 | Date |
---|---|---|
Vallie Joseph | c22ccee38a | 2 years ago |
Vallie Joseph | 34070387ee | 2 years ago |
Vallie Joseph | 58c9d1fc61 | 2 years ago |
Vallie Joseph | 13f797543f | 2 years ago |
Vallie Joseph | 763ea18a94 | 2 years ago |
Vallie Joseph | a20b6de448 | 2 years ago |
Vallie Joseph | 07918fc7c9 | 2 years ago |
Vallie Joseph | 24234e3dfa | 2 years ago |
Vallie Joseph | 637bbe688e | 2 years ago |
Vallie Joseph | b63c69da2f | 2 years ago |
Vallie Joseph | e3d7676897 | 2 years ago |
Vallie Joseph | f9c615037d | 2 years ago |
Vallie Joseph | 3a846c33d9 | 2 years ago |
Vallie Joseph | 2474b89272 | 2 years ago |
Vallie Joseph | 1e1c2b95ac | 2 years ago |
Vallie Joseph | 32ace3a191 | 2 years ago |
Vallie Joseph | 922e12e3a3 | 2 years ago |
Vallie Joseph | 68ee81ee89 | 2 years ago |
Vallie Joseph | ed4a43bf5c | 2 years ago |
Vallie Joseph | 24ec60a7c8 | 2 years ago |
Vallie Joseph | 669961e207 | 2 years ago |
Vallie Joseph | 74cc34423d | 2 years ago |
Vallie Joseph | 54974c739b | 2 years ago |
Vallie Joseph | e883ad6557 | 2 years ago |
Vallie Joseph | e67d32c5d0 | 2 years ago |
Vallie Joseph | 52a68f14f0 | 2 years ago |
Vallie Joseph | 8cab9170cf | 2 years ago |
@ -0,0 +1,20 @@
|
||||
---
|
||||
name: "@actions/io"
|
||||
version: 1.1.1
|
||||
type: npm
|
||||
summary: Actions exec lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE.md
|
||||
text: |-
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
notices: []
|
@ -0,0 +1,20 @@
|
||||
---
|
||||
name: "@actions/io"
|
||||
version: 1.1.2
|
||||
type: npm
|
||||
summary: Actions io lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/io
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE.md
|
||||
text: |-
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
notices: []
|
@ -1,80 +0,0 @@
|
||||
import * as exec from '@actions/exec'
|
||||
import * as fshelper from '../lib/fs-helper'
|
||||
import * as commandManager from '../lib/git-command-manager'
|
||||
|
||||
let git: commandManager.IGitCommandManager
|
||||
let mockExec = jest.fn()
|
||||
|
||||
describe('git-auth-helper tests', () => {
|
||||
beforeAll(async () => {})
|
||||
|
||||
beforeEach(async () => {
|
||||
jest.spyOn(fshelper, 'fileExistsSync').mockImplementation(jest.fn())
|
||||
jest.spyOn(fshelper, 'directoryExistsSync').mockImplementation(jest.fn())
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks()
|
||||
})
|
||||
|
||||
afterAll(() => {})
|
||||
|
||||
it('branch list matches', async () => {
|
||||
mockExec.mockImplementation((path, args, options) => {
|
||||
console.log(args, options.listeners.stdout)
|
||||
|
||||
if (args.includes('version')) {
|
||||
options.listeners.stdout(Buffer.from('2.18'))
|
||||
return 0
|
||||
}
|
||||
|
||||
if (args.includes('rev-parse')) {
|
||||
options.listeners.stdline(Buffer.from('refs/heads/foo'))
|
||||
options.listeners.stdline(Buffer.from('refs/heads/bar'))
|
||||
return 0
|
||||
}
|
||||
|
||||
return 1
|
||||
})
|
||||
jest.spyOn(exec, 'exec').mockImplementation(mockExec)
|
||||
const workingDirectory = 'test'
|
||||
const lfs = false
|
||||
git = await commandManager.createCommandManager(workingDirectory, lfs)
|
||||
|
||||
let branches = await git.branchList(false)
|
||||
|
||||
expect(branches).toHaveLength(2)
|
||||
expect(branches.sort()).toEqual(['foo', 'bar'].sort())
|
||||
})
|
||||
|
||||
it('ambiguous ref name output is captured', async () => {
|
||||
mockExec.mockImplementation((path, args, options) => {
|
||||
console.log(args, options.listeners.stdout)
|
||||
|
||||
if (args.includes('version')) {
|
||||
options.listeners.stdout(Buffer.from('2.18'))
|
||||
return 0
|
||||
}
|
||||
|
||||
if (args.includes('rev-parse')) {
|
||||
options.listeners.stdline(Buffer.from('refs/heads/foo'))
|
||||
// If refs/tags/v1 and refs/heads/tags/v1 existed on this repository
|
||||
options.listeners.errline(
|
||||
Buffer.from("error: refname 'tags/v1' is ambiguous")
|
||||
)
|
||||
return 0
|
||||
}
|
||||
|
||||
return 1
|
||||
})
|
||||
jest.spyOn(exec, 'exec').mockImplementation(mockExec)
|
||||
const workingDirectory = 'test'
|
||||
const lfs = false
|
||||
git = await commandManager.createCommandManager(workingDirectory, lfs)
|
||||
|
||||
let branches = await git.branchList(false)
|
||||
|
||||
expect(branches).toHaveLength(1)
|
||||
expect(branches.sort()).toEqual(['foo'].sort())
|
||||
})
|
||||
})
|
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue