Skip to content
This repository was archived by the owner on May 10, 2018. It is now read-only.

Commit cd4faed

Browse files
committed
ci: switch to CircleCI
1 parent d388250 commit cd4faed

File tree

5 files changed

+79
-232
lines changed

5 files changed

+79
-232
lines changed

Diff for: .circleci/config.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/graphql-cli-prepare
5+
docker:
6+
- image: circleci/node:latest
7+
steps:
8+
- checkout
9+
- run:
10+
name: update-npm
11+
command: 'sudo npm install -g yarn@latest'
12+
- restore_cache:
13+
key: dependency-cache-{{ checksum "package.json" }}
14+
- run:
15+
name: install-yarn
16+
command: yarn install
17+
- save_cache:
18+
key: dependency-cache-{{ checksum "package.json" }}
19+
paths:
20+
- ./node_modules
21+
- run:
22+
name: test
23+
command: yarn test
24+
- run:
25+
name: release
26+
command: yarn semantic-release || true

Diff for: .travis.yml

-24
This file was deleted.

Diff for: package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
"scripts": {
88
"prepublish": "npm run build",
99
"build": "rm -rf dist && tsc -d",
10+
"pretest": "npm run build",
1011
"test": "nyc cucumber-js --compiler ts:ts-node/register test/features/ -r test/step_definitions/ -f json:test/report/cucumber_report.json",
11-
"dposttest": "node test/createReport.js && nyc report --reporter=text-lcov | coveralls",
12+
"posttest": "node test/createReport.js && nyc report --reporter=text-lcov | coveralls",
13+
"vscodetest": "nyc --reporter=lcov --reporter=text-summary cucumber-js --compiler ts:ts-node/register test/features/ -r test/step_definitions/ -f ./test/tap-formatter.js",
1214
"semantic-release": "semantic-release"
1315
},
1416
"keywords": [
@@ -49,7 +51,7 @@
4951
"coveralls": "3.0.0",
5052
"cucumber": "3.2.0",
5153
"nyc": "11.4.1",
52-
"semantic-release": "11.1.0",
54+
"semantic-release": "12.1.0",
5355
"ts-node": "4.1.0",
5456
"typescript": "2.6.2"
5557
},

Diff for: test/tap-formatter.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const Formatter = require('cucumber/lib/formatter').default
2+
3+
class SummaryFormatter extends Formatter {
4+
constructor(options) {
5+
super(options)
6+
options.eventBroadcaster.on('test-run-finished', this.logSummary.bind(this))
7+
}
8+
9+
logSummary(testRun) {
10+
let counter = 1
11+
12+
const count = Object.keys(this.eventDataCollector.testCaseMap).length
13+
this.log(`TAP version 13\n`)
14+
this.log(`1..${count}\n`)
15+
for (const test in this.eventDataCollector.testCaseMap) {
16+
const testCase = this.eventDataCollector.testCaseMap[test]
17+
18+
const testCaseData = this.eventDataCollector.getTestCaseData(testCase.sourceLocation)
19+
20+
const featureName = testCaseData.gherkinDocument.feature.name
21+
const scenarioName = testCaseData.pickle.name
22+
const result = testCase.result.status
23+
24+
this.log(`${result === 'passed'? 'ok' : 'not ok'} ${counter} ${featureName} - ${scenarioName}\n`)
25+
26+
counter++
27+
}
28+
}
29+
}
30+
31+
exports.default = SummaryFormatter

0 commit comments

Comments
 (0)