Skip to content

Commit

Permalink
Merge pull request #86 from Yu1986/e2e
Browse files Browse the repository at this point in the history
add e2e test
  • Loading branch information
Yu1986 authored Feb 14, 2020
2 parents 8ae30a5 + 14890bb commit 2847f77
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
28 changes: 28 additions & 0 deletions e2e/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
Copyright 2019 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

const execa = require('execa')
const chalk = require('chalk')
const { stdout } = require('stdout-stderr')
const fs = require('fs')

stdout.print = true

test('list integrations test', async () => {
const packagejson = JSON.parse(fs.readFileSync('package.json').toString())
const name = `${packagejson.name}`
console.log(chalk.blue(`> e2e tests for ${chalk.bold(name)}`))

console.log(chalk.dim(` - list-integrations..`))
expect(() => { execa.sync('./bin/run', ['console:list-integrations', '-p', 'abc'], { stderr: 'inherit' }) }).not.toThrow()

console.log(chalk.green(` - done for ${chalk.bold(name)}`))
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"unit-tests": "jest --ci -w=2",
"prepack": "oclif-dev manifest && oclif-dev readme",
"postpack": "rm -f oclif.manifest.json",
"version": "oclif-dev readme && git add README.md"
"version": "oclif-dev readme && git add README.md",
"e2e": "jest --collectCoverage=false --testRegex './e2e/e2e.js'"
}
}

0 comments on commit 2847f77

Please sign in to comment.