Skip to content

Commit

Permalink
Merge pull request #49 from codeforequity-at/fix_binary
Browse files Browse the repository at this point in the history
Fix binary
  • Loading branch information
TestMyBot authored Feb 2, 2018
2 parents 7628cde + 820e950 commit 2c9381c
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 24 deletions.
4 changes: 2 additions & 2 deletions bin/testmybot.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ function handleOptions (argv) {
debug.enable('testmybot*,botium*')
}
if (argv.convos) {
require('../src/convo').setConvoDir(argv.convos)
require('../src/globals').get().convodir = argv.convos
}
if (argv.config) {
require('../src/readconfig').setConfigFile(argv.config)
require('../src/globals').get().configfile = argv.config
}
}

Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testmybot",
"version": "1.2.0",
"version": "1.2.1",
"engines": {
"node": ">=6.0"
},
Expand Down Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"async": "^2.1.5",
"body-parser": "^1.18.2",
"botium-core": "1.1.7",
"botium-core": "1.1.9",
"chai": "^4.1.2",
"chalk": "^2.3.0",
"clear": "0.0.1",
Expand Down
3 changes: 3 additions & 0 deletions samples/xlsx/jasmine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const bot = require('testmybot');

bot.helper.jasmine().generateJUnit();
Binary file not shown.
3 changes: 1 addition & 2 deletions samples/xlsx/testmybot.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"SIMPLEREST_METHOD": "GET",
"SIMPLEREST_HEADERS_TEMPLATE": "{ \"apiToken\": \"testapitoken\" }",
"SIMPLEREST_CONTEXT_JSONPATH": "$",
"SIMPLEREST_RESPONSE_JSONPATH": "$.text.*",
"SIMPLEREST_STRIP_HTML": true
"SIMPLEREST_RESPONSE_JSONPATH": "$.text.*"
}
}
}
7 changes: 6 additions & 1 deletion src/convo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ const path = require('path')
const mkdirp = require('mkdirp')
const debug = require('debug')('testmybot-convo')

const globals = require('./globals')

const allowedSuffices = ['.convo.txt', '.xlsx']

module.exports = class ConvoReader {
constructor (compiler, convodir = './spec/convo/') {
constructor (compiler, convodir) {
this.compiler = compiler
this.convodir = convodir
if (!this.convodir) {
this.convodir = globals.get().convodir
}
}

readConvos () {
Expand Down
12 changes: 12 additions & 0 deletions src/globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const settings = {
convodir: './spec/convo/',
configfile: 'testmybot.json'
}

function get () {
return settings
}

module.exports = {
get
}
4 changes: 3 additions & 1 deletion src/readconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ const fs = require('fs')
const _ = require('lodash')
const debug = require('debug')('testmybot-readconfig')

let configfile = 'testmybot.json'
const globals = require('./globals')

module.exports = (configToSet) => {
const resolvedConfig = {}

let configfile = globals.get().configfile

try {
const contents = fs.readFileSync(path.resolve(__dirname, '../testmybot.default.json'))
const configJson = JSON.parse(contents)
Expand Down
1 change: 0 additions & 1 deletion src/testmybot.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ module.exports = class TestMyBot {
})
.catch((err) => {
debug(convo.header.name + ' failed: ' + util.inspect(err))
failCb(err)
testcaseDone(err)
})
})
Expand Down

0 comments on commit 2c9381c

Please sign in to comment.