Skip to content

Commit

Permalink
Merge pull request #16 from ArnaudBuchholz/1.0.6
Browse files Browse the repository at this point in the history
1.0.6
  • Loading branch information
ArnaudBuchholz authored Aug 24, 2021
2 parents b5ca972 + 4c66cdd commit 987bd15
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
24 changes: 19 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,21 @@ const { watch } = require('fs')

function send (message) {
if (process.send) {
process.send(message)
process.send({
pid: process.pid,
...message
})
}
}

async function notifyAndExecuteTests (job) {
send({ msg: 'begin' })
try {
await executeTests(job)
send({ msg: 'end', status: job.failed || 0 })
} catch (error) {
console.error('ERROR', error)
send({ msg: 'error', error })
}
}

Expand All @@ -24,19 +38,19 @@ async function main () {
server
.on('ready', async ({ url, port }) => {
job.port = port
send({ msg: 'ready', port: job.port })
if (!job.logServer) {
console.log(`Server running at ${url}`)
}
send({ port })
await executeTests(job)
await notifyAndExecuteTests(job)
if (job.watch) {
delete job.start
if (!job.watching) {
console.log('Watching changes on', job.webapp)
watch(job.webapp, { recursive: true }, (eventType, filename) => {
console.log(eventType, filename)
if (!job.start) {
executeTests(job)
notifyAndExecuteTests(job)
}
})
job.watching = true
Expand All @@ -50,7 +64,7 @@ async function main () {
})
.on('error', error => {
console.error('ERROR', error)
send({ error })
send({ msg: 'error', error })
})
}

Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui5-test-runner",
"version": "1.0.5",
"version": "1.0.6",
"description": "Standalone test runner for UI5",
"main": "index.js",
"files": [
Expand Down
3 changes: 2 additions & 1 deletion src/ui5.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ module.exports = job => {
// UI5 from url
method: ['GET', 'HEAD'],
match,
url: `${job.ui5}/$1`
url: `${job.ui5}/$1`,
'ignore-unverifiable-certificate': true
}]

job.libs.forEach(({ relative, source }) => {
Expand Down

0 comments on commit 987bd15

Please sign in to comment.