kibana/packages/kbn-tinymath/test/functions/degtorad.test.js
Tyler Smalley 4681a80317
[DX] Upgrade prettier to v2.4.0 (#112359)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-19 22:34:30 -07:00

22 lines
739 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
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
const { degtorad } = require('../../src/functions/degtorad.js');
describe('Degrees to Radians', () => {
it('numbers', () => {
expect(degtorad(0)).toEqual(0);
expect(degtorad(90)).toEqual(1.5707963267948966);
});
it('arrays', () => {
expect(degtorad([0, 90, 180, 360])).toEqual([
0, 1.5707963267948966, 3.141592653589793, 6.283185307179586,
]);
});
});