Skip to content
Snippets Groups Projects
Select Git revision
  • fa30913dafdb19176d3e2342a34694fe2dec84f8
  • main default protected
  • next
  • revert-31645-feat/rename-gradle-wrapper-validation-action
  • renovate/main-redis-5.x
  • fix/36615b-branch-reuse-no-cache
  • chore/punycode
  • fix/36615-branch-reuse-bug
  • refactor/pin-new-value
  • feat/36219--git-x509-signing
  • feat/structured-logger
  • hotfix/39.264.1
  • feat/skip-dangling
  • gh-readonly-queue/next/pr-36034-7a061c4ca1024a19e2c295d773d9642625d1c2be
  • hotfix/39.238.3
  • refactor/gitlab-auto-approve
  • feat/template-strings
  • gh-readonly-queue/next/pr-35654-137d934242c784e0c45d4b957362214f0eade1d7
  • fix/32307-global-extends-merging
  • fix/32307-global-extends-repositories
  • gh-readonly-queue/next/pr-35009-046ebf7cb84ab859f7fefceb5fa53a54ce9736f8
  • 41.34.1
  • 41.34.0
  • 41.33.0
  • 41.32.3
  • 41.32.2
  • 41.32.1
  • 41.32.0
  • 41.31.1
  • 41.31.0
  • 41.30.5
  • 41.30.4
  • 41.30.3
  • 41.30.2
  • 41.30.1
  • 41.30.0
  • 41.29.1
  • 41.29.0
  • 41.28.2
  • 41.28.1
  • 41.28.0
41 results

promises.spec.ts

Blame
  • dependencySet.js 1.75 KiB
    // Sudoku Solver
    // Copyright (C) 2020  Christoph (Sheogorath) Kern
    //
    // This program is free software: you can redistribute it and/or modify
    // it under the terms of the GNU Affero General Public License as published
    // by the Free Software Foundation, either version 3 of the License, or
    // (at your option) any later version.
    //
    // This program is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU Affero General Public License for more details.
    //
    // You should have received a copy of the GNU Affero General Public License
    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    const Cell = require("../lib/cell");
    const DependencySet = require("../lib/dependencySet");
    const assert = require('assert');
    
    describe('DependencySet', function () {
      let cellSet;
      // disable debug output
      console.debug = function(){};
      beforeEach(() => {
        cellSet = [new Cell(), new Cell(), new Cell(), new Cell(), new Cell(), new Cell(), new Cell(), new Cell(), new Cell()];
      });
    
      describe('#constructor(cells)', function () {
        it('should create a DependencySet', function () {
          const dependencySet = new DependencySet(cellSet);
          assert.deepEqual(dependencySet.cells, cellSet);
        });
    
        it('should throw an error when more than 9 cells are added', function () {
          assert.throws(() => {
            new DependencySet(cellSet.concat([new Cell()]));
          }, Error);
        });
    
        it('should listen to changed events from cells', function () {
          const count = cellSet[0].listenerCount("changed");
          new DependencySet(cellSet);
    
          assert.equal(cellSet[0].listenerCount("changed"), count + 1);
        });
      });
    });