Sha256: 3251d7a8edc359d5ea3ebe1174aa989c54cfbe1d1299da4fd515ec8a8a8d8275

Contents?: true

Size: 1.77 KB

Versions: 69

Compression:

Stored size: 1.77 KB

Contents

'use strict';
/*jshint asi: true*/

// applying redeyed to a bunch of files of contained libraries as a smoke test
var test     =  require('tap').test
  , path     =  require('path')
  , fs       =  require('fs')
  , readdirp =  require('readdirp')
  , redeyed  =  require('..')
  , node_modules =  path.join(__dirname, '..', 'node_modules')
  , tapdir       =  path.join(node_modules, 'tap')
  , esprimadir   =  path.join(node_modules, 'esprima')

test('tap', function (t) {
  var invalidTapFiles = [
      'async-map-ordered.js'
    , 'prof.js'
  ]

  readdirp({ root: tapdir, fileFilter: '*.js' })
    .on('data', function (entry) {
      
      if (~invalidTapFiles.indexOf(entry.name)) return

      var code = fs.readFileSync(entry.fullPath, 'utf-8')
        , result = redeyed(code, { Keyword: { 'var': '+:-' } }).code

      t.assert(~result.indexOf('+var-') || !(~result.indexOf('var ')), 'redeyed ' + entry.path)
    })
    .on('end', t.end.bind(t))
})

test('esprima', function (t) {

  readdirp({ root: esprimadir, fileFilter: '*.js' })
    .on('data', function (entry) {
      
      var code = fs.readFileSync(entry.fullPath, 'utf-8')
        , result = redeyed(code, { Keyword: { 'var': '+:-' } }).code

      t.assert(~result.indexOf('+var-') || !(~result.indexOf('var ')), 'redeyed ' + entry.path)
    })
    .on('end', t.end.bind(t))
})

test('redeyed', function (t) {

  readdirp({ root: path.join(__dirname, '..'), fileFilter: '*.js', directoryFilter: ['!.git', '!node_modules' ] })
    .on('data', function (entry) {
      
      var code = fs.readFileSync(entry.fullPath, 'utf-8')
        , result = redeyed(code, { Keyword: { 'var': '+:-' } }).code

        t.assert(~result.indexOf('+var-') || !(~result.indexOf('var ')), 'redeyed ' + entry.path)
    })
    .on('end', t.end.bind(t))
})

Version data entries

69 entries across 69 versions & 2 rubygems

Version Path
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.18 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.17 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.16 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.15 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.14 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.13 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.12 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.11 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.10 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.9 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.8 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.7 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.6 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.5 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js
trusty-festivity-extension-2.5.4 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-smoke.js