Skip to content

Commit

Permalink
chore(deps-dev): Bump @readme/eslint-config from 1.13.0 to 1.14.0 (#148)
Browse files Browse the repository at this point in the history
* chore(deps-dev): Bump @readme/eslint-config from 1.13.0 to 1.14.0

Bumps [@readme/eslint-config](https://github.com/readmeio/eslint-config) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/readmeio/eslint-config/releases)
- [Changelog](https://github.com/readmeio/eslint-config/blob/master/CHANGELOG.md)
- [Commits](readmeio/standards@1.13.0...1.14.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* test: updating some wonky test assertions

Co-authored-by: Jon Ursenbach <[email protected]>
  • Loading branch information
dependabot-preview[bot] and erunion authored Mar 2, 2020
1 parent 1cf5660 commit 7068c39
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 51 deletions.
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"assertFunctionNames": [
"expect",
"nock.*.reply"
"nock.**.reply"
]
}
]
Expand Down
26 changes: 13 additions & 13 deletions test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,39 @@ describe('cli', () => {

it('should print usage for a given command', () => {
return cli(['swagger', '--help']).then(output => {
expect(output.indexOf(swaggerCmd.description) !== -1).toBeTruthy();
expect(output.indexOf(swaggerCmd.usage) !== -1).toBeTruthy();
expect(output.indexOf('--key') !== -1).toBeTruthy();
expect(output.indexOf('--help') !== -1).toBeTruthy();
expect(output).toContain(swaggerCmd.description);
expect(output).toContain(swaggerCmd.usage);
expect(output).toContain('--key');
expect(output).toContain('--help');
});
});

it('should print usage for a given command if supplied as `help <command>`', () => {
return cli(['help', 'swagger']).then(output => {
expect(output.indexOf(swaggerCmd.description) !== -1).toBeTruthy();
expect(output.indexOf(swaggerCmd.usage) !== -1).toBeTruthy();
expect(output.indexOf('--key') !== -1).toBeTruthy();
expect(output.indexOf('--help') !== -1).toBeTruthy();
expect(output).toContain(swaggerCmd.description);
expect(output).toContain(swaggerCmd.usage);
expect(output).toContain('--key');
expect(output).toContain('--help');
});
});

it('should not surface args that are designated as hidden', () => {
return cli(['swagger', '--help']).then(output => {
expect(output.indexOf('---token') === -1).toBeTruthy();
expect(output.indexOf('---spec') === -1).toBeTruthy();
expect(output).not.toContain('---token');
expect(output).not.toContain('---spec');
});
});

it('should show related commands for a subcommands help menu', () => {
return cli(['versions', '--help']).then(output => {
expect(output.indexOf('Related commands') !== -1).toBeTruthy();
expect(output.indexOf('versions:create') !== -1).toBeTruthy();
expect(output).toContain('Related commands');
expect(output).toContain('versions:create');
});
});

it('should not show related commands on commands that have none', () => {
return cli(['swagger', '--help']).then(output => {
expect(output.indexOf('Related commands') === -1).toBeTruthy();
expect(output).not.toContain('Related commands');
});
});
});
Expand Down
2 changes: 0 additions & 2 deletions test/cmds/docs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ describe('rdme docs', () => {
return docs.run({ folder: './test/fixtures/existing-docs', key, version }).then(() => {
getMock.done();
putMock.done();
expect(true).toBeTruthy();
});
});

Expand Down Expand Up @@ -135,7 +134,6 @@ describe('rdme docs', () => {
return docs.run({ folder: './test/fixtures/new-docs', key, version }).then(() => {
getMock.done();
postMock.done();
expect(true).toBeTruthy();
});
});
});
Expand Down
2 changes: 0 additions & 2 deletions test/cmds/swagger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ describe('rdme swagger', () => {

return swagger.run({ spec: './test/fixtures/swagger.json', key }).then(() => {
mock.done();
expect(true).toBeTruthy();
});
});

Expand All @@ -168,7 +167,6 @@ describe('rdme swagger', () => {

return swagger.run({ spec: './test/fixtures/swagger.json', key, id, version }).then(() => {
mock.done();
expect(true).toBeTruthy();
});
});

Expand Down
11 changes: 4 additions & 7 deletions test/cmds/versions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ describe('rdme versions*', () => {
.reply(200, [versionPayload, version2Payload]);

const table = await versions.run({ key });
expect(table.indexOf(version) !== -1).toBeTruthy();
expect(table.indexOf(version2) !== -1).toBeTruthy();
expect(table).toContain(version);
expect(table).toContain(version2);
mockRequest.done();
});

Expand All @@ -75,8 +75,8 @@ describe('rdme versions*', () => {
.reply(200, versionPayload);

return versions.run({ key, version }).then(table => {
expect(table.indexOf(version) !== -1).toBeTruthy();
expect(table.indexOf(version2) === -1).toBeTruthy();
expect(table).toContain(version);
expect(table).not.toContain(version2);
mockRequest.done();
});
});
Expand Down Expand Up @@ -126,7 +126,6 @@ describe('rdme versions*', () => {

return createVersion.run({ key, version }).then(() => {
mockRequest.done();
expect(true).toBeTruthy();
});
});

Expand Down Expand Up @@ -172,7 +171,6 @@ describe('rdme versions*', () => {

return deleteVersion.run({ key, version }).then(() => {
mockRequest.done();
expect(true).toBeTruthy();
});
});

Expand Down Expand Up @@ -221,7 +219,6 @@ describe('rdme versions*', () => {

return updateVersion.run({ key, version }).then(() => {
mockRequest.done();
expect(true).toBeTruthy();
});
});

Expand Down
20 changes: 10 additions & 10 deletions test/lib/commands.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ describe('utils', () => {
commands.forEach(c => {
const cmd = c.command;

expect(typeof cmd.command === 'string' && cmd.command.length !== 0).toBeTruthy();
expect(typeof cmd.usage === 'string' && cmd.usage.length !== 0).toBeTruthy();
expect(typeof cmd.description === 'string' && cmd.usage.description !== 0).toBeTruthy();
expect(typeof cmd.category === 'string' && cmd.usage.category !== 0).toBeTruthy();
expect(typeof cmd.position === 'number' && cmd.usage.position !== 0).toBeTruthy();
expect(Array.isArray(cmd.args)).toBeTruthy();
expect(typeof cmd.run === 'function').toBeTruthy();
expect(typeof cmd.command === 'string' && cmd.command.length !== 0).toBe(true);
expect(typeof cmd.usage === 'string' && cmd.usage.length !== 0).toBe(true);
expect(typeof cmd.description === 'string' && cmd.usage.description !== 0).toBe(true);
expect(typeof cmd.category === 'string' && cmd.usage.category !== 0).toBe(true);
expect(typeof cmd.position === 'number' && cmd.usage.position !== 0).toBe(true);
expect(Array.isArray(cmd.args)).toBe(true);
expect(typeof cmd.run === 'function').toBe(true);

if (cmd.args.length > 0) {
cmd.args.forEach(arg => {
expect(typeof arg.name === 'string' && arg.name.length !== 0).toBeTruthy();
expect(typeof arg.type !== 'undefined').toBeTruthy();
expect(typeof arg.name === 'string' && arg.name.length !== 0).toBe(true);
expect(typeof arg.type !== 'undefined').toBe(true);
});
}

expect(cmd.usage.indexOf(cmd.command) !== -1).toBeTruthy();
expect(cmd.usage.indexOf(cmd.command) !== -1).toBe(true);
});
});

Expand Down

0 comments on commit 7068c39

Please sign in to comment.