
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
yeoman-assert
Advanced tools
yeoman-assert
is extending the native Node.js assert
module. Every methods in assert
also is available with yeoman-assert
, plus some code scaffolding related assertion helpers.
$ npm install yeoman-assert
const assert = require('yeoman-assert');
assert(true);
assert.equal(1, 1);
assert.file()
Assert that a file exists.
assert.file('templates/user.hbs');
Assert that each files in the array exists.
assert.file(['templates/user.hbs', 'templates/user/edit.hbs']);
assert.noFile()
Assert that a file doesn't exists.
assert.noFile('templates/user.hbs');
Assert that each of an array of files doesn't exist.
assert.noFile(['templates/user.hbs', 'templates/user/edit.hbs']);
assert.fileContent()
Assert that a file's content matches a string.
assert.fileContent('models/user.js', 'App.User = DS.Model.extend');
Assert that a file's content matches a regex.
assert.fileContent('models/user.js', /App\.User = DS\.Model\.extend/);
Assert that each of an array of files content matches a regex or string.
assert.fileContent([
['models/user.js', 'App.User = DS.Model.extend'],
['controllers/user.js', /App\.UserController = Ember\.ObjectController\.extend/]
]);
assert.noFileContent()
Assert that a file's content does not match a string.
assert.noFileContent('models/user.js', 'App.User = DS.Model.extend');
Assert that a file's content does not match a regex.
assert.noFileContent('models/user.js', /App\.User = DS\.Model\.extend/);
Assert that each of an array of files content does not match a regex or string.
assert.noFileContent([
['models/user.js', 'App.User = DS.Model.extend'],
['controllers/user.js', /App\.UserController = Ember\.ObjectController\.extend/]
]);
assert.textEqual()
Assert that two strings are equal after standardization of newlines.
assert.textEqual('I have a yellow cat', 'I have a yellow cat');
assert.implement()
Assert an Object implements an interface.
assert.implement(fs, ['readFile']);
assert.notImplement()
Assert an Object doesn't implements any method of an interface.
assert.notImplement(fs, ['foo']);
assert.objectContent()
Assert an object contains at least a set of keys
var anObject = {a: 1};
assert.objectContent(anObject, {a: 2});
assert.noObjectContent()
Assert an object does not contain at least a set of keys
var anObject = {a: 1};
assert.noObjectContent(anObject, {a: 1});
assert.jsonFileContent()
Assert a JSON file contains at least a set of keys (rely of assert.objectContent()
)
assert.jsonFileContent('path/to/file.json', {a: 2});
assert.noJsonFileContent()
Assert a JSON file does not contain at least a set of keys (rely of assert.noObjectContent()
)
assert.noJsonFileContent('path/to/file.json', {a: 1});
See the contributing docs.
BSD-2-Clause © Google
FAQs
Assert utility from yeoman
The npm package yeoman-assert receives a total of 29,583 weekly downloads. As such, yeoman-assert popularity was classified as popular.
We found that yeoman-assert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.