[pack installer] modified tests to make paths platform agnostic

This commit is contained in:
Jim Unger 2016-03-04 12:34:59 -06:00
parent 659a437195
commit c86b13edc2
5 changed files with 16 additions and 15 deletions

View file

@ -21,7 +21,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();
});

View file

@ -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();
});

View file

@ -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');

View file

@ -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');
@ -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);

View file

@ -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);
});