How to use the yeoman-assert.fileContent function in yeoman-assert

To help you get started, we’ve selected a few yeoman-assert 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 bastienmichaux / generator-jhipster-db-helper / test / test-dbh.js View on Github external
it('works', function () {
            // write a temp file
            let tempFilePath = path.join(__dirname, './testDir/tempDir/myTest.json');
            let content = {foo: 'bar'};
            let replacedContent = {foo: 'fuz'};

            assert.noFile(tempFilePath);
            fse.writeJsonSync(tempFilePath, content);
            assert.file(tempFilePath);
            assert.fileContent(tempFilePath, 'bar');
            dbh.replaceContent(tempFilePath, 'bar', 'fuz', null);
            assert.fileContent(tempFilePath, 'fuz');
            fs.unlinkSync(tempFilePath);
            assert.noFile(tempFilePath);
        });
    });
github micromata / generator-baumeister / __tests__ / test-app.js View on Github external
it('should have authors name in package.json and LICENSE', () => {
    const packageJson = JSON.parse(fs.readFileSync('package.json'));
    const regex = new RegExp(escapeStringRegexp(prompts.authorName), '');

    packageJson.should.have
      .propertyByPath('author', 'name')
      .eql(prompts.authorName);
    assert.fileContent('LICENSE', regex);
  });
github micromata / generator-baumeister / __tests__ / test-app.js View on Github external
it('should render project name and description in README.md', () => {
    let regex = new RegExp(escapeStringRegexp(prompts.projectDescription), '');
    assert.fileContent('README.md', regex);
    regex = new RegExp(
      escapeStringRegexp(_s.titleize(prompts.projectName)),
      ''
    );
    assert.fileContent('README.md', regex);
  });
github micromata / generator-baumeister / __tests__ / test-app.js View on Github external
it('should render project name and description in README.md', () => {
    let regex = new RegExp(escapeStringRegexp(prompts.projectDescription), '');
    assert.fileContent('README.md', regex);
    regex = new RegExp(
      escapeStringRegexp(_s.titleize(prompts.projectName)),
      ''
    );
    assert.fileContent('README.md', regex);
  });
github franzip / generator-hapi-api-stack / test / auth.js View on Github external
it('fills the authentication file with correct information', (done) => {
    const regex = new RegExp(`'${prompts.strategyName}', '${prompts.pluginName}', {}`);

    assert.fileContent(expected, regex);

    done();
  });
});

yeoman-assert

Assert utility from yeoman

BSD-2-Clause
Latest version published 7 years ago

Package Health Score

57 / 100
Full package analysis