This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: pass build target into package task use the build target for the zip output * chore: change up the npm scripts * chore: add create package tests * chore: update eslint deps * chore: fix linting issues, add engines
- Loading branch information
Showing
8 changed files
with
576 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
--- | ||
extends: "@elastic/kibana" | ||
|
||
rules: | ||
prefer-object-spread/prefer-object-spread: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/*eslint-env jest*/ | ||
const { resolve } = require('path'); | ||
const { statSync } = require('fs'); | ||
const del = require('del'); | ||
const createBuild = require('./create_build'); | ||
const createPackage = require('./create_package'); | ||
|
||
const PLUGIN_FIXTURE = resolve(__dirname, '__fixtures__/test_plugin'); | ||
const PLUGIN = require('../../lib/plugin_config')(PLUGIN_FIXTURE); | ||
const PLUGIN_BUILD_DIR = resolve(PLUGIN_FIXTURE, 'build-custom'); | ||
|
||
describe('create_build', () => { | ||
const buildVersion = PLUGIN.version; | ||
const kibanaVersion = PLUGIN.version; | ||
const buildFiles = PLUGIN.buildSourcePatterns; | ||
const packageFile = `${PLUGIN.id}-${buildVersion}.zip`; | ||
const doBuild = () => createBuild(PLUGIN, PLUGIN_BUILD_DIR, buildVersion, kibanaVersion, buildFiles); | ||
|
||
beforeAll(() => del(PLUGIN_BUILD_DIR).then(doBuild)); | ||
afterAll(() => del(PLUGIN_BUILD_DIR)); | ||
|
||
describe('creating the package', function () { | ||
it('creates zip file in build target path', function () { | ||
return createPackage(PLUGIN, PLUGIN_BUILD_DIR, buildVersion) | ||
.then(() => { | ||
const zipFile = resolve(PLUGIN_BUILD_DIR, packageFile); | ||
const stats = statSync(zipFile); | ||
expect(stats.isFile()).toBeTruthy(); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.