Files
xahau.js/test/models/utils.ts
Nathan Nichols 8b95ee5fab build: Initial linting setup (#1560)
* sets up linting config and runs `yarn lint --fix` once, so that all changes will show up correctly in future PRs.

* Note that there are still a lot of linter errors.
2021-10-04 14:10:10 -04:00

31 lines
669 B
TypeScript

import { assert } from "chai";
import { isFlagEnabled } from "../../src/models/utils";
/**
* Utils Testing.
*
* Provides tests for utils used in models.
*/
describe("Models Utils", function () {
describe("isFlagEnabled", function () {
let flags;
const flag1 = 0x00010000;
const flag2 = 0x00020000;
beforeEach(function () {
flags = 0x00000000;
});
it("verifies a flag is enabled", function () {
flags += flag1 + flag2;
assert.isTrue(isFlagEnabled(flags, flag1));
});
it("verifies a flag is not enabled", function () {
flags += flag2;
assert.isFalse(isFlagEnabled(flags, flag1));
});
});
});