Skip to content
Snippets Groups Projects
Select Git revision
  • b821680aef3bbb59a2f093e5b22bf2e89696dc1f
  • master default protected
  • v1.23.2
  • v1.23.1
  • v1.23.0
  • v1.22.0
  • v1.21.1
  • v1.21.0
  • v1.20.3
  • v1.20.2
  • v1.20.1
  • v1.20.0
  • v1.19.4
  • v1.19.3
  • v1.19.2
  • v1.19.1
  • v1.19.0
  • v1.18.2
  • v1.18.1
  • v1.18.0
  • v1.17.0
  • v1.16.1
22 results

collations.go

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();
                    })
    
                });
    
            });
    
        });
    });