mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
* Create KuiButton, KuiLinkButton, KuiSubmitButton, and KuiButtonIcon React components in UI Framework. * Add Jest test coverage for UI Framework, generate report in ui_framework/jest/report. * Add UI Framework to linting task. * Update UI Framework README with instructions on creating and testing React components. * Add both React and HTML examples. * Add UI Framework Jest tests to npm test script. Create separate scripts for watching and generating coverage reports. * Fix appearance of kuiButtons with icons throughout Kibana, by adding a flexbox wrapper. * Improve accessibility of kuiButtonIcon. * Remove disabled attribute from KuiLinkButton. * Remove kuiButton-isDisabled class from KuiButton and KuiSubmitButton.
37 lines
926 B
JavaScript
37 lines
926 B
JavaScript
const platform = require('os').platform();
|
|
const config = require('./utils/ui_framework_test_config');
|
|
|
|
module.exports = function (grunt) {
|
|
grunt.registerTask('uiFramework:test', function () {
|
|
const done = this.async();
|
|
Promise.all([uiFrameworkTest()]).then(done);
|
|
});
|
|
|
|
function uiFrameworkTest() {
|
|
const serverCmd = {
|
|
cmd: /^win/.test(platform) ? '.\\node_modules\\.bin\\jest.cmd' : './node_modules/.bin/jest',
|
|
args: [
|
|
'--env=jsdom',
|
|
`--config=${JSON.stringify(config)}`,
|
|
],
|
|
opts: { stdio: 'inherit' }
|
|
};
|
|
|
|
return new Promise((resolve, reject) => {
|
|
grunt.util.spawn(serverCmd, (error, result, code) => {
|
|
if (error || code !== 0) {
|
|
const message = result.stderr || result.stdout;
|
|
|
|
grunt.log.error(message);
|
|
|
|
return reject();
|
|
}
|
|
|
|
grunt.log.writeln(result);
|
|
|
|
resolve();
|
|
});
|
|
|
|
});
|
|
}
|
|
};
|