program.test.js
This file
Path
tests/program.test.js
68 lines · 1.5 KiB · JavaScript
Last changed by
Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
History of this fileTake it
The walk stopped after 200 commits: lines older than 2911e0e point at it.
Merge pull request #2140 from tj/release/12.xJohn Geebefore adoptione3192a1
lines 1–11why, one step back1const {2 program,3 Command,4 Option,5 Argument,6 Help,7 CommanderError,8 InvalidArgumentError,9 InvalidOptionArgumentError,10 createCommand,11 createOption,Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 12why, one step back12 createArgument,Merge pull request #2140 from tj/release/12.xJohn Geebefore adoptione3192a1
line 13why, one step back13} = require('../index.js');docs: update SECURITY.mdabetomobefore adoption2911e0e
lines 14–15why, one step back1415// Do some testing of the default export(s).Merge pull request #2140 from tj/release/12.xJohn Geebefore adoptione3192a1
line 16why, one step back16// Similar tests to ts-imports.test.ts and esm-imports-test.js.docs: update SECURITY.mdabetomobefore adoption2911e0e
line 17why, one step back17Merge pull request #2140 from tj/release/12.xJohn Geebefore adoptione3192a1
lines 18–26why, one step back18/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["expect", "checkClass"] }] */1920function checkClass(obj, name) {21 expect(typeof obj).toEqual('object');22 expect(obj.constructor.name).toEqual(name);23}2425test('program', () => {26 checkClass(program, 'Command');docs: update SECURITY.mdabetomobefore adoption2911e0e
lines 27–28why, one step back27});28Merge pull request #2140 from tj/release/12.xJohn Geebefore adoptione3192a1
lines 29–30why, one step back29test('Command', () => {30 checkClass(new Command('name'), 'Command');docs: update SECURITY.mdabetomobefore adoption2911e0e
lines 31–32why, one step back31});32Merge pull request #2140 from tj/release/12.xJohn Geebefore adoptione3192a1
lines 33–52why, one step back33test('Option', () => {34 checkClass(new Option('-e, --example', 'description'), 'Option');35});3637test('Argument', () => {38 checkClass(new Argument('<foo>', 'description'), 'Argument');39});4041test('Help', () => {42 checkClass(new Help(), 'Help');43});4445test('CommanderError', () => {46 checkClass(new CommanderError(1, 'code', 'failed'), 'CommanderError');47});4849test('InvalidArgumentError', () => {50 checkClass(new InvalidArgumentError('failed'), 'InvalidArgumentError');51});52Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
lines 53–54why, one step back53test('InvalidOptionArgumentError', () => {54 // DeprecatedMerge pull request #2140 from tj/release/12.xJohn Geebefore adoptione3192a1
lines 55–67why, one step back55 checkClass(new InvalidOptionArgumentError('failed'), 'InvalidArgumentError');56});5758test('createCommand', () => {59 checkClass(createCommand('foo'), 'Command');60});6162test('createOption', () => {63 checkClass(createOption('-e, --example', 'description'), 'Option');64});6566test('createArgument', () => {67 checkClass(createArgument('<foo>', 'description'), 'Argument');docs: update SECURITY.mdabetomobefore adoption2911e0e
line 68why, one step back68});