How to use the jest-docblock.parse function in jest-docblock

To help you get started, we’ve selected a few jest-docblock 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 facebookincubator / fbt / packages / babel-plugin-fbt / index.js View on Github external
function initDefaultOptions(state) {
  defaultOptions = {};
  const comment = state.file.ast.comments[0];
  const docblock = (comment && comment.value) || '';
  const fbtDocblockOptions = parseDocblock(docblock).fbt;
  if (fbtDocblockOptions) {
    defaultOptions = JSON.parse(fbtDocblockOptions);
    Object.keys(defaultOptions).forEach(o => checkOption(o, ValidFbtOptions));
  }
  if (!defaultOptions.project) {
    defaultOptions.project = '';
  }
}
github facebookincubator / fbt / packages / babel-plugin-fbt / index.js View on Github external
function initDefaultOptions(state) {
  defaultOptions = {};
  const comment = state.file.ast.comments[0];
  const docblock = (comment && comment.value) || '';
  const fbtDocblockOptions = parseDocblock(docblock).fbt;
  if (fbtDocblockOptions) {
    defaultOptions = JSON.parse(fbtDocblockOptions);
    Object.keys(defaultOptions).forEach(o => checkOption(o, ValidFbtOptions));
  }
  if (!defaultOptions.project) {
    defaultOptions.project = '';
  }
}
github tophat / sanity-runner / service / src / alertOnResult.js View on Github external
module.exports = async function(testFiles, results, testVariables) {
    if (testVariables.hasOwnProperty('ALERT')) {
        if (testVariables.ALERT && results.numFailedTests > 0) {
            for (const testFile of Object.keys(testFiles)) {
                const testContents = testFiles[testFile]
                const testMetaData = parse(testContents)
                await sendSlackMessage(
                    results,
                    testFile,
                    testMetaData,
                    testVariables,
                )
            }
        }
    }
}

jest-docblock

`jest-docblock` is a package that can extract and parse a specially-formatted comment called a "docblock" at the top of a file.

MIT
Latest version published 8 months ago

Package Health Score

91 / 100
Full package analysis

Similar packages