Skip to content

Commit

Permalink
Merge pull request #106 from Yu1986/e2e
Browse files Browse the repository at this point in the history
add e2e test
  • Loading branch information
Yu1986 committed Feb 14, 2020
2 parents 1d6e4dc + f38b5ce commit 9c9f9f4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
27 changes: 27 additions & 0 deletions e2e/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
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('aio-cli-plugin-runtime 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.bold(' - listing actions'))
expect(() => { execa.sync('./bin/run', ['runtime:action:list'], { stderr: 'inherit' }) }).not.toThrow()
console.log(chalk.green(` - done for ${chalk.bold(name)}`))
})
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@
"main": "src/runtime-helpers.js",
"repository": "adobe/aio-cli-plugin-runtime",
"scripts": {
"eslint-fix": "eslint src test --fix",
"posttest": "eslint src test",
"eslint-fix": "eslint src test e2e --fix",
"posttest": "eslint src test e2e",
"test": "npm run unit-tests",
"unit-tests": "jest --ci",
"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'"
},
"jest": {
"collectCoverage": true,
Expand Down

0 comments on commit 9c9f9f4

Please sign in to comment.