How to use the folio.wrapper function in folio

To help you get started, we’ve selected a few folio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chaijs / chai / support / compile.js View on Github external
var folio = require('folio');

folio('chai')
  .root(__dirname, '..')
  .use(folio.requires())
    .dir('./lib')
    .package('chai')
    .entry('./chai.js')
    .pop()
  .use(folio.indent())
    .line('  ')
    .pop()
  .use(folio.wrapper())
    .prefix([
        '!function (name, context, definition) {'
      , '  if (typeof require === \'function\' && typeof exports === \'object\' && typeof module === \'object\') {'
      , '    module.exports = definition();'
      , '  } else if (typeof define === \'function\' && typeof define.amd  === \'object\') {'
      , '    define(function () {'
      , '      return definition();'
      , '    });'
      , '  } else {'
      , '    context[name] = definition();'
      , '  }'
      , '}(\'chai\', this, function () {\n'
    ].join('\n'))
    .suffix([
        '\n  return require(\'chai\');'
      , '});'

folio

A customizable test framework to build your own test frameworks. Foundation for the [Playwright test runner](https://github.com/microsoft/playwright-test).

Apache-2.0
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis