add backwards compatbility for tests with a deprecation message

This commit is contained in:
Iuri Matias 2017-03-11 21:49:12 -05:00
parent 1534bf6207
commit 9eb4887d37
4 changed files with 18 additions and 3 deletions

View File

@ -198,5 +198,17 @@ var Embark = function () {
}; };
Embark.initTests = function() {
console.error("=============================".green);
console.error("deprecated: Starting with Embark 2.5.0 the Embark object needs to be initialized".red);
console.log("replace:");
console.log("var Embark = require('embark');");
console.log("with:");
console.log("var Embark = require('embark')();");
console.error("=============================".green);
var embark = Embark();
return embark.initTests();
};
module.exports = Embark; module.exports = Embark;

View File

@ -1,10 +1,11 @@
var assert = require('assert'); var assert = require('assert');
var Embark = require('embark'); var Embark = require('embark')();
var EmbarkSpec = Embark.initTests(); var EmbarkSpec = Embark.initTests();
var web3 = EmbarkSpec.web3; var web3 = EmbarkSpec.web3;
describe("AnotherStorage", function() { describe("AnotherStorage", function() {
before(function(done) { before(function(done) {
this.timeout(0);
var contractsConfig = { var contractsConfig = {
"SimpleStorage": { "SimpleStorage": {
args: [100] args: [100]

View File

@ -1,10 +1,11 @@
var assert = require('assert'); var assert = require('assert');
var Embark = require('embark'); var Embark = require('embark')();
var EmbarkSpec = Embark.initTests(); var EmbarkSpec = Embark.initTests();
var web3 = EmbarkSpec.web3; var web3 = EmbarkSpec.web3;
describe("SimpleStorage", function() { describe("SimpleStorage", function() {
before(function(done) { before(function(done) {
this.timeout(0);
var contractsConfig = { var contractsConfig = {
"SimpleStorage": { "SimpleStorage": {
args: [100] args: [100]

View File

@ -1,10 +1,11 @@
var assert = require('assert'); var assert = require('assert');
var Embark = require('embark'); var Embark = require('embark')();
var EmbarkSpec = Embark.initTests(); var EmbarkSpec = Embark.initTests();
var web3 = EmbarkSpec.web3; var web3 = EmbarkSpec.web3;
describe("Token", function() { describe("Token", function() {
before(function(done) { before(function(done) {
this.timeout(0);
var contractsConfig = { var contractsConfig = {
"SimpleStorage": { "SimpleStorage": {
args: [100] args: [100]