MOON
Server: Apache
System: Linux 54-179-220-51.cprapid.com 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64
User: thehunarfound (1001)
PHP: 7.4.29
Disabled: NONE
Upload Files
File: /home/thehunarfound/public_html/DMS/node_modules/degenerator/test/test.js
/**
 * Module dependencies.
 */

var fs = require('fs');
var path = require('path');
var assert = require('assert');
var degenerator = require('../');

describe('degenerator()', function () {

  describe('"expected" fixture tests', function () {

    fs.readdirSync(__dirname).forEach(function (n) {
      if ('test.js' == n) return;
      if (/\.expected\.js$/.test(n)) return;
      var expectedName = path.basename(n, '.js') + '.expected.js';

      it(n + ' → ' + expectedName, function () {
        var sourceName = path.resolve(__dirname, n);
        var compiledName = path.resolve(__dirname, expectedName);
        var js = fs.readFileSync(sourceName, 'utf8');
        var expected = fs.readFileSync(compiledName, 'utf8');

        // the test case can define the `names` to use as a
        // comment on the first line of the file
        var names = js.match(/\/\/\s*(.*)/);
        if (names) {
          // the comment should be a comma-separated list of function names
          names = names[1].split(/,\s*/);
        } else {
          // if no function names were passed in then convert them all
          names = [ /.*/ ];
        }

        var compiled = degenerator(js, names);
        assert.equal(expected.trim(), compiled.trim());
      });
    });

  });

});
;;