From d2faab515bf592d1e0f27f480d1dcc286a64de9a Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Thu, 31 Jan 2019 20:12:13 -0500 Subject: [PATCH] Return expectation promise in CLI test cases --- __tests__/cli.test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/__tests__/cli.test.js b/__tests__/cli.test.js index 47c2bc57b709..9ecf4f1bcff7 100644 --- a/__tests__/cli.test.js +++ b/__tests__/cli.test.js @@ -16,21 +16,21 @@ describe('cli', () => { describe('init', () => { it('creates a Tailwind config file', () => { - cli(['init']).then(() => { + return cli(['init']).then(() => { expect(utils.writeFile.mock.calls[0][0]).toEqual(constants.defaultConfigFile) expect(utils.writeFile.mock.calls[0][1]).toContain('defaultConfig') }) }) it('creates a Tailwind config file in a custom location', () => { - cli(['init', 'custom.js']).then(() => { + return cli(['init', 'custom.js']).then(() => { expect(utils.writeFile.mock.calls[0][0]).toEqual('custom.js') expect(utils.writeFile.mock.calls[0][1]).toContain('defaultConfig') }) }) it('creates a Tailwind config file without comments', () => { - cli(['init', '--no-comments']).then(() => { + return cli(['init', '--no-comments']).then(() => { expect(utils.writeFile.mock.calls[0][1]).not.toContain('/**') expect(utils.writeFile.mock.calls[0][1]).toContain('//') }) @@ -39,32 +39,32 @@ describe('cli', () => { describe('build', () => { it('compiles CSS file', () => { - cli(['build', inputCssPath]).then(() => { + return cli(['build', inputCssPath]).then(() => { expect(process.stdout.write.mock.calls[0][0]).toContain('.example') }) }) it('compiles CSS file using custom configuration', () => { - cli(['build', inputCssPath, '--config', customConfigPath]).then(() => { + return cli(['build', inputCssPath, '--config', customConfigPath]).then(() => { expect(process.stdout.write.mock.calls[0][0]).toContain('400px') }) }) it('creates compiled CSS file', () => { - cli(['build', inputCssPath, '--output', 'output.css']).then(() => { + return cli(['build', inputCssPath, '--output', 'output.css']).then(() => { expect(utils.writeFile.mock.calls[0][0]).toEqual('output.css') expect(utils.writeFile.mock.calls[0][1]).toContain('.example') }) }) it('compiles CSS file with autoprefixer', () => { - cli(['build', inputCssPath]).then(() => { + return cli(['build', inputCssPath]).then(() => { expect(process.stdout.write.mock.calls[0][0]).toContain('-ms-input-placeholder') }) }) it('compiles CSS file without autoprefixer', () => { - cli(['build', inputCssPath, '--no-autoprefixer']).then(() => { + return cli(['build', inputCssPath, '--no-autoprefixer']).then(() => { expect(process.stdout.write.mock.calls[0][0]).not.toContain('-ms-input-placeholder') }) })