Skip to content
Permalink
Browse files
Use global fixtures for invalid-ID tests too
  • Loading branch information
raphinesse committed May 14, 2018
1 parent 4f4987e commit 1eaf74d9f65830a736c1c0628e2f2c0b6a245aa5
Showing 1 changed file with 12 additions and 12 deletions.
@@ -45,16 +45,26 @@ if (!global_config_path) {
global_config_path = path.join(HOME, '.cordova');
}

// Setup and teardown test dirs
beforeEach(function () {
shell.rm('-rf', project);
shell.mkdir('-p', tmpDir);
});
afterEach(function () {
process.chdir(path.join(__dirname, '..')); // Needed to rm the dir on Windows.
shell.rm('-rf', tmpDir);
});

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

it('should reject reserved words from end of id', function () {
return create('projectPath', 'bob.class', 'appName', {}, events)
return create(project, 'bob.class', appName, {}, events)
.catch(function (err) {
expect(err.message).toBe('App id contains a reserved word, or is not a valid identifier.');
});
@@ -63,16 +73,6 @@ describe('cordova create checks for valid-identifier', function () {

describe('create end-to-end', function () {

beforeEach(function () {
shell.rm('-rf', project);
shell.mkdir('-p', tmpDir);
});

afterEach(function () {
process.chdir(path.join(__dirname, '..')); // Needed to rm the dir on Windows.
shell.rm('-rf', tmpDir);
});

function checkProject () {
// Check if top level dirs exist.
var dirs = ['hooks', 'platforms', 'plugins', 'www'];

0 comments on commit 1eaf74d

Please sign in to comment.