Skip to content

Commit

Permalink
trying to fix tests on pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
MuriloChianfa committed Dec 7, 2023
1 parent d2605ca commit a0319d9
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
node_modules/
coverage/
coverage/
encrypted/
25 changes: 20 additions & 5 deletions __tests__/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@ describe('action', () => {
expect(runMock).toHaveReturned()

// Verify that all of the core library functions were called correctly with default values
expect(debugMock).toHaveBeenNthCalledWith(1, 'Encoding files using template: laravel')
expect(debugMock).toHaveBeenNthCalledWith(2, 'Using encoder version: current')
expect(debugMock).toHaveBeenNthCalledWith(3, 'Using PHP target version: 8.2')
expect(debugMock).toHaveBeenNthCalledWith(4, 'Using target architecture: x86-64')
expect(debugMock).toHaveBeenNthCalledWith(
1,
'Encoding files using template: laravel'
)
expect(debugMock).toHaveBeenNthCalledWith(
2,
'Using encoder version: current'
)
expect(debugMock).toHaveBeenNthCalledWith(
3,
'Using PHP target version: 8.2'
)
expect(debugMock).toHaveBeenNthCalledWith(
4,
'Using target architecture: x86-64'
)
expect(debugMock).toHaveBeenNthCalledWith(5, 'Using input files: .')
expect(debugMock).toHaveBeenNthCalledWith(6, 'Using output path: encrypted')

Expand All @@ -35,6 +47,9 @@ describe('action', () => {
expect(debugMock).toHaveBeenNthCalledWith(8, '')
expect(debugMock).toHaveBeenNthCalledWith(9, '')

expect(setOutputMock).toHaveBeenCalledWith('status', 'Project encoded with success')
expect(setOutputMock).toHaveBeenCalledWith(
'status',
'Project encoded with success'
)
}, 20000)
})
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion dist/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/evaluation.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ module.exports = async function evaluation() {
const cwd = process.cwd()

if (!fs.existsSync('ioncube_encoder_evaluation')) {
await download('https://www.ioncube.com/eval_linux', `${cwd}/ioncube_encoder_evaluation.tar.gz`)
await download(
'https://www.ioncube.com/eval_linux',
`${cwd}/ioncube_encoder_evaluation.tar.gz`
)
await tar.extract({ file: `${cwd}/ioncube_encoder_evaluation.tar.gz` })

if (fs.existsSync(`${cwd}/ioncube_encoder_evaluation.tar.gz`)) {
Expand Down
3 changes: 2 additions & 1 deletion src/inputs/encoder-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const core = require('@actions/core')
* @returns {string} Returns a validated encoder-version input.
*/
module.exports = function validateEncoderVersion(standard = 'current') {
let encoderVersion = core.getInput('encoder-version', { required: true }) ?? standard
let encoderVersion =
core.getInput('encoder-version', { required: true }) ?? standard

core.debug(`Using encoder version: ${encoderVersion}`)

Expand Down
3 changes: 2 additions & 1 deletion src/inputs/php-target-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const core = require('@actions/core')
* @returns {string} Returns a validated php-target-version input.
*/
module.exports = function validatePhpTargetVersion(standard = '8.2') {
let phpTargetVersion = core.getInput('php-target-version', { required: true }) ?? standard
let phpTargetVersion =
core.getInput('php-target-version', { required: true }) ?? standard

core.debug(`Using PHP target version: ${phpTargetVersion}`)

Expand Down

0 comments on commit a0319d9

Please sign in to comment.