mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Added non-IfStatement test for isIfStatementNodeWithSingleStatementBody method
This commit is contained in:
@@ -79,7 +79,22 @@ describe('NodeGuards', () => {
|
||||
});
|
||||
|
||||
describe('false checks', () => {
|
||||
describe('Variant #1: multiple statements `consequent` and `alternate`', () => {
|
||||
describe('Variant #1: other node', () => {
|
||||
const expectedResult: boolean = false;
|
||||
const node: ESTree.Literal = NodeFactory.literalNode(true);
|
||||
|
||||
let result: boolean;
|
||||
|
||||
before(() => {
|
||||
result = NodeGuards.isIfStatementNodeWithSingleStatementBody(node);
|
||||
});
|
||||
|
||||
it('should return `false` for other node', () => {
|
||||
assert.equal(result, expectedResult);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Variant #2: multiple statements `consequent` and `alternate`', () => {
|
||||
const expectedResult: boolean = false;
|
||||
const node: ESTree.IfStatement = NodeFactory.ifStatementNode(
|
||||
NodeFactory.literalNode(true),
|
||||
|
||||
Reference in New Issue
Block a user