From 3a50dbdfdd3a120c87c7a3c1ed498826e795503c Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sat, 11 Mar 2017 22:16:24 -0500 Subject: [PATCH] remove deprecation warning; put tests back to previous method; fix eslint error --- boilerplate/test/contract_spec.js | 2 +- demo/test/simple_storage_spec.js | 2 +- lib/index.js | 16 ++-------------- test_app/test/another_storage_spec.js | 2 +- test_app/test/simple_storage_spec.js | 2 +- test_app/test/token_spec.js | 2 +- 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/boilerplate/test/contract_spec.js b/boilerplate/test/contract_spec.js index 0e39bdf0f..e732155dc 100644 --- a/boilerplate/test/contract_spec.js +++ b/boilerplate/test/contract_spec.js @@ -1,5 +1,5 @@ var assert = require('assert'); -var Embark = require('embark')(); +var Embark = require('embark'); var EmbarkSpec = Embark.initTests(); var web3 = EmbarkSpec.web3; diff --git a/demo/test/simple_storage_spec.js b/demo/test/simple_storage_spec.js index 55dfe63fd..b2d3cb178 100644 --- a/demo/test/simple_storage_spec.js +++ b/demo/test/simple_storage_spec.js @@ -1,5 +1,5 @@ var assert = require('assert'); -var Embark = require('embark')(); +var Embark = require('embark'); var EmbarkSpec = Embark.initTests(); var web3 = EmbarkSpec.web3; diff --git a/lib/index.js b/lib/index.js index e60b26813..46271baf5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -13,7 +13,7 @@ var Swarm = require('./upload/swarm.js'); var version = require('../package.json').version; -var Embark = function () { +var Embark = (function () { function initConfig (env, options) { var Events = require('./core/events.js'); var Logger = require('./core/logger.js'); @@ -196,19 +196,7 @@ var Embark = function () { upload: upload }; -}(); - -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; diff --git a/test_app/test/another_storage_spec.js b/test_app/test/another_storage_spec.js index ad12778d2..d0e90c60d 100644 --- a/test_app/test/another_storage_spec.js +++ b/test_app/test/another_storage_spec.js @@ -1,5 +1,5 @@ var assert = require('assert'); -var Embark = require('embark')(); +var Embark = require('embark'); var EmbarkSpec = Embark.initTests(); var web3 = EmbarkSpec.web3; diff --git a/test_app/test/simple_storage_spec.js b/test_app/test/simple_storage_spec.js index 55dfe63fd..b2d3cb178 100644 --- a/test_app/test/simple_storage_spec.js +++ b/test_app/test/simple_storage_spec.js @@ -1,5 +1,5 @@ var assert = require('assert'); -var Embark = require('embark')(); +var Embark = require('embark'); var EmbarkSpec = Embark.initTests(); var web3 = EmbarkSpec.web3; diff --git a/test_app/test/token_spec.js b/test_app/test/token_spec.js index 8bbb4d2b1..362ce058b 100644 --- a/test_app/test/token_spec.js +++ b/test_app/test/token_spec.js @@ -1,5 +1,5 @@ var assert = require('assert'); -var Embark = require('embark')(); +var Embark = require('embark'); var EmbarkSpec = Embark.initTests(); var web3 = EmbarkSpec.web3;