Skip to content
Snippets Groups Projects
Select Git revision
  • 56cc03a85c90b2c5a45e1318a47d87dc7c89620e
  • master default protected
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • v1.1.0
8 results

thunderclient.css

Blame
  • andoperator.mjs 1.04 KiB
    import {Valid} from "../../../../application/source/constraints/valid.mjs";
    import {Invalid} from "../../../../application/source/constraints/invalid.mjs";
    import {AndOperator} from "../../../../application/source/constraints/andoperator.mjs";
    
    describe('AndOperator', function () {
    
        describe('.isValid()', function () {
    
            [
                [new Valid(), new Valid(), true],
                [new Valid(), new Invalid(), false],
                [new Invalid(), new Valid(), false],
                [new Invalid(), new Invalid(), false]
            ].forEach(function (data) {
    
                let a = data.shift()
                let b = data.shift()
                let c = data.shift()
    
                it('constraint.isValid() should return ' + c, function (done) {
    
                    let constraint = new AndOperator(a, b);
                    constraint.isValid().then(() => {
                        c === true ? done() : done(new Error());
                    }).catch(() => {
                        c === true ? done(new Error()) : done();
                    })
    
                });
    
            });
    
        });
    });