Skip to content

Commit

Permalink
[pack installer] modified tests to make paths platform agnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
BigFunger committed Mar 7, 2016
1 parent bb7f0ee commit 91cce98
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ program
.description('Get the help for a specific command')
.action(function (cmdName) {
var cmd = _.find(program.commands, { _name: cmdName });
if (!cmd) return this.error(`unknown command ${cmdName}`);
if (!cmd) return program.error(`unknown command ${cmdName}`);
cmd.help();
});

Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ program
.description('Get the help for a specific command')
.action(function (cmdName) {
var cmd = _.find(program.commands, { _name: cmdName });
if (!cmd) return this.error(`unknown command ${cmdName}`);
if (!cmd) return program.error(`unknown command ${cmdName}`);
cmd.help();
});

Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/__tests__/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { join } from 'path';

describe('kibana cli', function () {

describe('plugin extractor', function () {
describe('pack', function () {

const testWorkingPath = join(__dirname, '.test.data');
const tempArchiveFilePath = join(testWorkingPath, 'archive.part');
Expand Down
24 changes: 12 additions & 12 deletions src/cli_plugin/install/__tests__/zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { listFiles, extractFiles } from '../zip';

describe('kibana cli', function () {

describe('plugin extractor', function () {
describe('zip', function () {

const testWorkingPath = join(__dirname, '.test.data');
const tempArchiveFilePath = join(testWorkingPath, 'archive.part');
Expand Down Expand Up @@ -59,17 +59,17 @@ describe('kibana cli', function () {
})
.then((actual) => {
const expected = [
'elasticsearch\\',
'kibana\\',
'kibana\\test-plugin\\',
'kibana\\test-plugin\\.gitignore',
'kibana\\test-plugin\\extra file only in zip.txt',
'kibana\\test-plugin\\index.js',
'kibana\\test-plugin\\package.json',
'kibana\\test-plugin\\public\\',
'kibana\\test-plugin\\public\\app.js',
'kibana\\test-plugin\\README.md',
'logstash\\'
'elasticsearch/',
'kibana/',
'kibana/test-plugin/',
'kibana/test-plugin/.gitignore',
'kibana/test-plugin/extra file only in zip.txt',
'kibana/test-plugin/index.js',
'kibana/test-plugin/package.json',
'kibana/test-plugin/public/',
'kibana/test-plugin/public/app.js',
'kibana/test-plugin/README.md',
'logstash/'
];

expect(actual).to.eql(expected);
Expand Down
1 change: 1 addition & 0 deletions src/cli_plugin/install/zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export async function listFiles(zipPath) {
unzipper.on('error', reject);

unzipper.on('list', (files) => {
files = files.map((file) => file.replace(/\\/g, '/'));
resolve(files);
});

Expand Down

0 comments on commit 91cce98

Please sign in to comment.