ember-cli-addon-tests
Advanced tools
Comparing version 0.5.1 to 0.6.0
'use strict'; | ||
var App = require('./models/app'); | ||
var AddonTestApp = require('./models/addon-test-app'); | ||
module.exports = { | ||
App: App, | ||
AddonTestApp: AddonTestApp | ||
}; |
var fs = require('fs-extra'); | ||
var path = require('path'); | ||
var findup = require('findup-sync'); | ||
var startServer = require('../commands/start-server'); | ||
var chdir = require('../utilities/chdir'); | ||
var util = require('util'); | ||
var App = require('./app'); | ||
var debug = require('../utilities/debug'); | ||
var runCommand = require('../utilities/run-command'); | ||
var pristine = require('../utilities/pristine'); | ||
@@ -13,4 +12,7 @@ var RSVP = require('rsvp'); | ||
function AddonTestApp() { | ||
App.call(this); | ||
} | ||
util.inherits(AddonTestApp, App); | ||
// Public API for putting an app under test. If the app doesn't | ||
@@ -36,23 +38,2 @@ // exist already, it will create it and put it into the `pristine` | ||
AddonTestApp.prototype.run = function() { | ||
var previousCwd = process.cwd(); | ||
chdir(this.path); | ||
return runCommand.apply(null, arguments) | ||
.finally(function() { | ||
chdir(previousCwd); | ||
}); | ||
}; | ||
AddonTestApp.prototype.runEmberCommand = function() { | ||
var cliPath = path.join(this.path, 'node_modules', 'ember-cli', 'bin', 'ember'); | ||
var args = Array.prototype.slice.apply(arguments); | ||
return this.run.apply(this, [cliPath].concat(args)); | ||
}; | ||
AddonTestApp.prototype.filePath = function(filePath) { | ||
return path.join(this.path, filePath); | ||
}; | ||
AddonTestApp.prototype.editPackageJSON = function(cb) { | ||
@@ -65,25 +46,2 @@ var packageJSONPath = path.join(this.path, 'package.json'); | ||
AddonTestApp.prototype.startServer = function(options) { | ||
var app = this; | ||
var previousCwd = process.cwd(); | ||
process.chdir(app.path); | ||
return startServer(options) | ||
.then(function(server) { | ||
app.server = server; | ||
process.chdir(previousCwd); | ||
}); | ||
}; | ||
AddonTestApp.prototype.stopServer = function() { | ||
if (!this.server) { | ||
throw new Error("You must call `startServer()` before calling `stopServer()`."); | ||
} | ||
this.server.kill('SIGINT'); | ||
this.server = null; | ||
return RSVP.resolve(); | ||
}; | ||
function copyFixtureFiles(appName, destDir, fixturesPath) { | ||
@@ -90,0 +48,0 @@ fixturesPath = findup(fixturesPath || 'test/fixtures'); |
{ | ||
"name": "ember-cli-addon-tests", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "A set of integration test helpers for Ember CLI addons", | ||
@@ -32,3 +32,3 @@ "main": "lib/index.js", | ||
"debug": "^2.2.0", | ||
"exists-sync": "0.0.3", | ||
"exists-sync": "0.0.4", | ||
"findup-sync": "^0.3.0", | ||
@@ -42,3 +42,6 @@ "fs-extra": "^0.24.0", | ||
"temp": "^0.8.3" | ||
}, | ||
"engines": { | ||
"node": ">= 4" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29820
18
652
2
+ Addedexists-sync@0.0.4(transitive)
- Removedexists-sync@0.0.3(transitive)
Updatedexists-sync@0.0.4