Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit d561bbf

Browse files
committed
fix: lint issues
1 parent 809f184 commit d561bbf

File tree

2 files changed

+102
-102
lines changed

2 files changed

+102
-102
lines changed

test/command.test.ts

+88-88
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,50 @@ class Command extends Base {
1616

1717
describe('command', () => {
1818
fancy
19-
.stdout()
20-
.do(() => Command.run([]))
21-
.do(output => expect(output.stdout).to.equal('foo\n'))
22-
.it('logs to stdout')
19+
.stdout()
20+
.do(() => Command.run([]))
21+
.do(output => expect(output.stdout).to.equal('foo\n'))
22+
.it('logs to stdout')
2323

2424
fancy
25-
.do(async () => {
26-
class Command extends Base {
27-
static description = 'test command'
25+
.do(async () => {
26+
class Command extends Base {
27+
static description = 'test command'
2828

29-
async run() {
30-
return 101
29+
async run() {
30+
return 101
31+
}
3132
}
32-
}
3333

34-
expect(await Command.run([])).to.equal(101)
35-
})
36-
.it('returns value')
34+
expect(await Command.run([])).to.equal(101)
35+
})
36+
.it('returns value')
3737

3838
fancy
39-
.do(() => {
40-
class Command extends Base {
41-
async run() {
42-
throw new Error('new x error')
39+
.do(() => {
40+
class Command extends Base {
41+
async run() {
42+
throw new Error('new x error')
43+
}
4344
}
44-
}
4545

46-
return Command.run([])
47-
})
48-
.catch(/new x error/)
49-
.it('errors out')
46+
return Command.run([])
47+
})
48+
.catch(/new x error/)
49+
.it('errors out')
5050

5151
fancy
52-
.stdout()
53-
.do(() => {
54-
class Command extends Base {
55-
async run() {
56-
this.exit(0)
52+
.stdout()
53+
.do(() => {
54+
class Command extends Base {
55+
async run() {
56+
this.exit(0)
57+
}
5758
}
58-
}
59-
return Command.run([])
60-
})
61-
.catch(/EEXIT: 0/)
62-
.it('exits with 0')
59+
return Command.run([])
60+
})
61+
.catch(/EEXIT: 0/)
62+
.it('exits with 0')
6363

6464
describe('convertToCached', () => {
6565
fancy
@@ -140,11 +140,11 @@ describe('command', () => {
140140
// ],
141141
// })
142142
// })
143-
.it('converts to cached with everything set')
143+
.it('converts to cached with everything set')
144144

145145
fancy
146146
// .skip()
147-
.do(async () => {
147+
.do(async () => {
148148
// const c = class extends Command {
149149
// }.convertToCached()
150150
// expect(await c.load()).to.have.property('run')
@@ -162,9 +162,9 @@ describe('command', () => {
162162
// flags: {},
163163
// args: [],
164164
// })
165-
})
165+
})
166166

167-
.it('adds plugin name')
167+
.it('adds plugin name')
168168

169169
fancy
170170
// .skip()
@@ -187,90 +187,90 @@ describe('command', () => {
187187
// args: [],
188188
// })
189189
// })
190-
.it('converts to cached with nothing set')
190+
.it('converts to cached with nothing set')
191191
})
192192

193193
describe('parse', () => {
194194
fancy
195-
.stdout()
196-
.it('has a flag', async ctx => {
197-
class CMD extends Base {
198-
static flags = {
199-
foo: flags.string()
200-
}
195+
.stdout()
196+
.it('has a flag', async ctx => {
197+
class CMD extends Base {
198+
static flags = {
199+
foo: flags.string()
200+
}
201201

202-
async run() {
203-
const {flags} = this.parse(CMD)
204-
this.log(flags.foo)
202+
async run() {
203+
const {flags} = this.parse(CMD)
204+
this.log(flags.foo)
205+
}
205206
}
206-
}
207207

208-
await CMD.run(['--foo=bar'])
209-
expect(ctx.stdout).to.equal('bar\n')
210-
})
208+
await CMD.run(['--foo=bar'])
209+
expect(ctx.stdout).to.equal('bar\n')
210+
})
211211
})
212212

213213
describe('version', () => {
214214
fancy
215-
.stdout()
216-
.add('config', () => Config.load())
217-
.do(async () => {
218-
await Command.run(['--version'])
219-
})
220-
.catch(/EEXIT: 0/)
221-
.it('shows version', ctx => {
222-
expect(ctx.stdout).to.equal(`${ctx.config.userAgent}\n`)
223-
})
215+
.stdout()
216+
.add('config', () => Config.load())
217+
.do(async () => {
218+
await Command.run(['--version'])
219+
})
220+
.catch(/EEXIT: 0/)
221+
.it('shows version', ctx => {
222+
expect(ctx.stdout).to.equal(`${ctx.config.userAgent}\n`)
223+
})
224224
})
225225

226226
describe('help', () => {
227227
fancy
228-
.stdout()
229-
.do(() => {
230-
class CMD extends Command {
231-
static flags = {help: flags.help()}
232-
}
233-
return CMD.run(['--help'])
234-
})
235-
.catch(/EEXIT: 0/)
236-
.it('--help', ctx => {
237-
expect(ctx.stdout).to.equal(`test command
228+
.stdout()
229+
.do(() => {
230+
class CMD extends Command {
231+
static flags = {help: flags.help()}
232+
}
233+
return CMD.run(['--help'])
234+
})
235+
.catch(/EEXIT: 0/)
236+
.it('--help', ctx => {
237+
expect(ctx.stdout).to.equal(`test command
238238
239239
USAGE
240240
$ @oclif/command
241241
242242
OPTIONS
243243
--help show CLI help
244244
`)
245-
})
245+
})
246246

247247
fancy
248-
.stdout()
249-
.do(async () => {
250-
class CMD extends Command {}
251-
await CMD.run(['-h'])
252-
})
253-
.catch(/EEXIT: 0/)
254-
.it('-h', ctx => {
248+
.stdout()
249+
.do(async () => {
250+
class CMD extends Command {}
251+
await CMD.run(['-h'])
252+
})
253+
.catch(/EEXIT: 0/)
254+
.it('-h', ctx => {
255255
// expect(process.exitCode).to.equal(0)
256-
expect(ctx.stdout).to.equal(`test command
256+
expect(ctx.stdout).to.equal(`test command
257257
258258
USAGE
259259
$ @oclif/command
260260
`)
261-
})
261+
})
262262
})
263263

264264
describe('.log()', () => {
265265
fancy
266-
.stdout()
267-
.do(async () => {
268-
class CMD extends Command {
269-
async run() { this.log('json output: %j', {a: 'foobar'}) }
270-
}
271-
await CMD.run([])
272-
})
273-
.do(ctx => expect(ctx.stdout).to.equal('json output: {"a":"foobar"}\n'))
274-
.it('uses util.format()')
266+
.stdout()
267+
.do(async () => {
268+
class CMD extends Command {
269+
async run() { this.log('json output: %j', {a: 'foobar'}) }
270+
}
271+
await CMD.run([])
272+
})
273+
.do(ctx => expect(ctx.stdout).to.equal('json output: {"a":"foobar"}\n'))
274+
.it('uses util.format()')
275275
})
276276
})

test/main.test.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ const version = `@oclif/command/${pjson.version} ${process.platform}-${process.a
77

88
describe('main', () => {
99
fancy
10-
.stdout()
11-
.do(() => Main.run(['plugins']))
12-
.do(output => expect(output.stdout).to.equal('no plugins installed\n'))
13-
.it('runs plugins')
10+
.stdout()
11+
.do(() => Main.run(['plugins']))
12+
.do(output => expect(output.stdout).to.equal('no plugins installed\n'))
13+
.it('runs plugins')
1414

1515
fancy
16-
.stdout()
17-
.do(() => Main.run(['-v']))
18-
.catch('EEXIT: 0')
19-
.do(output => expect(output.stdout).to.equal(version + '\n'))
20-
.it('runs -v')
16+
.stdout()
17+
.do(() => Main.run(['-v']))
18+
.catch('EEXIT: 0')
19+
.do(output => expect(output.stdout).to.equal(version + '\n'))
20+
.it('runs -v')
2121

2222
fancy
23-
.stdout()
24-
.do(() => Main.run(['-h']))
25-
.catch('EEXIT: 0')
26-
.do(output => expect(output.stdout).to.equal(`oclif base command
23+
.stdout()
24+
.do(() => Main.run(['-h']))
25+
.catch('EEXIT: 0')
26+
.do(output => expect(output.stdout).to.equal(`oclif base command
2727
2828
VERSION
2929
${version}
@@ -36,5 +36,5 @@ COMMANDS
3636
plugins list installed plugins
3737
3838
`))
39-
.it('runs -h')
39+
.it('runs -h')
4040
})

0 commit comments

Comments
 (0)