add screenshots and images for docs. add icon.
This commit is contained in:
14
lib/__tests__/dimensions-test.ts
Normal file
14
lib/__tests__/dimensions-test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { diameterToLength, length_t } from '../dimensions';
|
||||
|
||||
describe('diameterToLength', () => {
|
||||
it('should throw an error if the units of the outer and inner diameters do not match', () => {
|
||||
expect(() => diameterToLength({ l: 10, u: 'inch' }, { l: 8, u: 'foot' }, 2)).toThrow('diameter units must match!');
|
||||
});
|
||||
|
||||
it('should return the correct length for multiple rings with different units', () => {
|
||||
const outer : length_t = {l: 25, u: "in"};
|
||||
const inner: length_t = {l : 1, u: "in"};
|
||||
const l = diameterToLength(outer, inner, 12);
|
||||
expect(l.l).toBeCloseTo(490, -1.0);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user