Merge pull request #548 from embark-framework/warn_about_embark_spec

warn about EmbarkSpec deprecation
This commit is contained in:
Iuri Matias 2018-06-18 12:54:41 -04:00 committed by GitHub
commit ce8e333685
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -56,12 +56,16 @@ module.exports = {
global.assert = assert; global.assert = assert;
global.config = test.config.bind(test); global.config = test.config.bind(test);
global.deployAll = function () { let deprecatedWarning = function() {
console.error(__('%s is not supported anymore', 'deployAll').red); console.error(__('%s are not supported anymore', 'EmbarkSpec & deployAll').red);
console.info(__('You can learn about the new revamped tests here: %s', 'https://embark.status.im/docs/testing.html'.underline)); console.info(__('You can learn about the new revamped tests here: %s', 'https://embark.status.im/docs/testing.html'.underline));
process.exit(); process.exit();
}; };
global.deployAll = deprecatedWarning;
global.EmbarkSpec = {};
global.EmbarkSpec.deployAll = deprecatedWarning;
// Override require to enable `require('Embark/contracts/contractName');` // Override require to enable `require('Embark/contracts/contractName');`
const Module = require('module'); const Module = require('module');
const originalRequire = require('module').prototype.require; const originalRequire = require('module').prototype.require;