HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/cwd/home/arjun/projects/buyercall/node_modules/material-colors/test/module.js
var test = require('tape');
var fs = require('fs');
var path = require('path');
var tmp = require('tmp');
var rollup = require('rollup');
var execSync = require('child_process').execSync;

var node = process.argv[0];
var fixtures = fs.readdirSync(path.join(__dirname, 'fixtures'));

fixtures.forEach(function (fixture) {
  test('module: ' + fixture, function (t) {
    t.plan(1);

    var filename = path.join(__dirname, 'fixtures', fixture);
    rollup.rollup({ entry: filename })
      .then(function (bundle) {
        var js = bundle.generate({ format: 'es' }).code;

        var tmpfile = tmp.fileSync().name;
        var command = `"${node}" ${tmpfile}`;
        fs.writeFileSync(tmpfile, js);
        var stdout = execSync(command).toString().trim();

        t.equal(stdout, '#ffebee');
      });
  });
});