mirror of
https://github.com/liabru/matter-js.git
synced 2025-03-14 00:38:41 -04:00
Body.getAngularSpeed unit tests
This commit is contained in:
parent
48c9a89bad
commit
fcb9d206f7
1 changed files with 25 additions and 0 deletions
|
@ -1698,6 +1698,31 @@ describe('Body.setAngularVelocity', () => {
|
|||
// Act
|
||||
let result = () => Body.setAngularVelocity(body, velocity);
|
||||
|
||||
// Assert
|
||||
// TODO: This causes a read or set from undefined. This should probably be fixed.
|
||||
expect(result).toThrow(/^Cannot .* properties of undefined \(.* '.*'\)$/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Body.getAngularSpeed', () => {
|
||||
it('should be able to get the angular speed from a valid body', () => {
|
||||
// Arrange
|
||||
const body = getTestBodyWithPartsWithParent();
|
||||
|
||||
// Act
|
||||
let result = Body.getAngularSpeed(body);
|
||||
|
||||
// Assert
|
||||
assertFloat(result, 0.13333333333333333);
|
||||
});
|
||||
|
||||
it('should not be able to get the angular speed from an undefined body', () => {
|
||||
// Arrange
|
||||
const body = undefined;
|
||||
|
||||
// Act
|
||||
let result = () => Body.getAngularSpeed(body);
|
||||
|
||||
// Assert
|
||||
// TODO: This causes a read or set from undefined. This should probably be fixed.
|
||||
expect(result).toThrow(/^Cannot .* properties of undefined \(.* '.*'\)$/);
|
||||
|
|
Loading…
Add table
Reference in a new issue