Skip to content
Permalink
Browse files
removed stripping eventlisteners
  • Loading branch information
stevengill committed Sep 2, 2016
1 parent 2cc4e1f commit b61f8706c7b3568e1a64fbab6daf9af8ea2b7fd5
Showing 2 changed files with 13 additions and 18 deletions.
@@ -55,9 +55,6 @@ function setupEvents(externalEventEmitter) {
return events;
}

function cleanupEvents() {
events.removeAllListeners();
}
/**
* Usage:
* @dir - directory where the project will be created. Required.
@@ -314,8 +311,6 @@ module.exports = function(dir, optionalId, optionalName, cfg, extEvents) {
conf.setVersion('1.0.0');
conf.write();
}
}).then(function(){
cleanupEvents();
});
};

@@ -478,4 +473,4 @@ function writeToConfigJson(project_root, opts, autoPersist) {
if (!fs.existsSync(copyDst) && fs.existsSync(copySrc)) {
shell.cp(copySrc, projectDir);
}
}
}
@@ -73,15 +73,15 @@ var configNPM = {

describe('cordova create checks for valid-identifier', function() {
it('should reject reserved words from start of id', function(done) {
create('projectPath', 'int.bob', 'appName')
create('projectPath', 'int.bob', 'appName', {}, events)
.fail(function(err) {
expect(err.message).toBe('App id contains a reserved word, or is not a valid identifier.');
})
.fin(done);
}, 60000);

it('should reject reserved words from end of id', function(done) {
create('projectPath', 'bob.class', 'appName')
create('projectPath', 'bob.class', 'appName', {}, events)
.fail(function(err) {
expect(err.message).toBe('App id contains a reserved word, or is not a valid identifier.');
})
@@ -188,7 +188,7 @@ describe('create end-to-end', function() {
it('should successfully run with Git URL', function(done) {
// Call cordova create with no args, should return help.)
// Create a real project
return create(project, appId, appName, configGit)
return create(project, appId, appName, configGit, events)
.then(checkProject)
.fail(function(err) {
console.log(err && err.stack);
@@ -222,7 +222,7 @@ describe('create end-to-end', function() {
}
};
// Create a real project
return create(project, appId, appName, config)
return create(project, appId, appName, config, events)
.then(checkProject)
.then(function(){
// Check that we got the right config.xml
@@ -248,7 +248,7 @@ describe('create end-to-end', function() {
}
};
// Create a real project
return create(project, appId, appName, config)
return create(project, appId, appName, config, events)
.then(checkProject)
.fail(function(err) {
console.log(err && err.stack);
@@ -270,7 +270,7 @@ describe('create end-to-end', function() {
};

// Create a real project
return create(project, appId, appName, config)
return create(project, appId, appName, config, events)
.then(checkProject)
.fail(function(err) {
console.log(err && err.stack);
@@ -283,7 +283,7 @@ describe('create end-to-end', function() {
it('should successfully run with template having package.json, and subdirectory, and package.json in subdirectory', function(done) {
// Call cordova create with no args, should return help.
var config = configSubDirPkgJson;
return create(project, appId, appName, config)
return create(project, appId, appName, config, events)
.then(checkSubDir)
.fail(function(err) {
console.log(err && err.stack);
@@ -296,7 +296,7 @@ describe('create end-to-end', function() {
// Call cordova create with no args, should return help.
var config = configConfigInWww;
// Create a real project
return create(project, appId, appName, config)
return create(project, appId, appName, config, events)
.then(checkConfigXml)
.fail(function(err) {
console.log(err && err.stack);
@@ -315,7 +315,7 @@ describe('create end-to-end', function() {
}
}
};
return create(project, appId, appName, config)
return create(project, appId, appName, config, events)
.then(checkConfigXml)
.fail(function(err) {
console.log(err && err.stack);
@@ -372,7 +372,7 @@ describe('create end-to-end', function() {
}
}
};
return create(project, appId, appName, config)
return create(project, appId, appName, config, events)
.then(checkSymWWW)
.fail(function(err) {
if(process.platform.slice(0, 3) == 'win') {
@@ -431,7 +431,7 @@ describe('create end-to-end', function() {
}
}
};
return create(project, appId, appName, config)
return create(project, appId, appName, config, events)
.then(checkSymSubDir)
.fail(function(err) {
if(process.platform.slice(0, 3) == 'win') {
@@ -481,7 +481,7 @@ describe('create end-to-end', function() {
}
}
};
return create(project, appId, appName, config)
return create(project, appId, appName, config, events)
.then(checkSymNoConfig)
.fail(function(err) {
if(process.platform.slice(0, 3) == 'win') {

0 comments on commit b61f870

Please sign in to comment.