mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
* Tinymath is now a Kibana package * Rename to @kbn/tinymath * Update import style * Update README * Use commonjs import syntax * Fix to commonjs export * More commonjs fixes
22 lines
738 B
JavaScript
22 lines
738 B
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* and the Server Side Public License, v 1; you may not use this file except in
|
|
* compliance with, at your election, the Elastic License or the Server Side
|
|
* Public License, v 1.
|
|
*/
|
|
|
|
const { fix } = require('../../src/functions/fix.js');
|
|
|
|
describe('Fix', () => {
|
|
it('numbers', () => {
|
|
expect(fix(-10.5)).toEqual(-10);
|
|
expect(fix(-10.1)).toEqual(-10);
|
|
expect(fix(10.9)).toEqual(10);
|
|
});
|
|
|
|
it('arrays', () => {
|
|
expect(fix([-10.5, -20.9, -30.1, -40.2])).toEqual([-10, -20, -30, -40]);
|
|
expect(fix([2.9, 5.1, 3.5, 4.3])).toEqual([2, 5, 3, 4]);
|
|
});
|
|
});
|