codeceptjs
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -7,2 +7,3 @@ #!/usr/bin/env node | ||
var Config = require('../lib/config'); | ||
var Codecept = require('../lib/codecept'); | ||
var print = require('../lib/output'); | ||
@@ -9,0 +10,0 @@ var fileExists = require('../lib/utils').fileExists; |
@@ -26,4 +26,4 @@ 'use strict'; | ||
// generates empty test | ||
module.exports.test = function(args) { | ||
let testsPath = getTestRoot(args.path); | ||
module.exports.test = function(path) { | ||
let testsPath = getTestRoot(path); | ||
let config = getConfig(testsPath); | ||
@@ -80,4 +80,4 @@ if (!config) return; | ||
module.exports.pageObject = function(args) { | ||
let testsPath = getTestRoot(args.path); | ||
module.exports.pageObject = function(path) { | ||
let testsPath = getTestRoot(path); | ||
let config = getConfig(testsPath); | ||
@@ -84,0 +84,0 @@ let kind = args.kind || 'page'; |
@@ -9,3 +9,4 @@ 'use strict'; | ||
let fileExists = require('../utils').fileExists; | ||
var inquirer = require("inquirer"); | ||
let inquirer = require("inquirer"); | ||
let getTestRoot = require("./utils").getTestRoot; | ||
@@ -40,4 +41,4 @@ let defaultConfig = { | ||
module.exports = function(args, cb) { | ||
let testsPath = path.join(process.cwd(), args.path || './test'); | ||
module.exports = function(initPath) { | ||
let testsPath = getTestRoot(initPath); | ||
@@ -50,3 +51,3 @@ print(); | ||
if (!args.path) { | ||
if (!path) { | ||
print(`No test root specified.`); | ||
@@ -53,0 +54,0 @@ print(`Test root is assumed to be ${colors.yellow.bold(testsPath)}`); |
@@ -22,5 +22,6 @@ 'use strict'; | ||
if (!fileExists(configFile)) { | ||
throw new Error(output.styles.error(`Can't load config from ${configFile}. File doesn't exists`)); | ||
output.error(`Can't load config from ${configFile}\nCodeceptJS is not initialized in this dir. Execute 'codeceptjs init' to start`); | ||
process.exit(1); | ||
} | ||
return JSON.parse(fs.readFileSync(configFile, 'utf8')); | ||
} |
{ | ||
"name": "codeceptjs", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Modern Era Aceptance Testing Framework for NodeJS", | ||
@@ -5,0 +5,0 @@ "homepage": "http://codecept.io", |
69338
2058