Skip to content

Commit

Permalink
fix e2e test for async refactor branch (#49)
Browse files Browse the repository at this point in the history
additionally replaces travis with circle ci
  • Loading branch information
hafizalfaza committed Mar 2, 2019
1 parent b63ab6d commit 3d828d5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2.0
jobs:
test:
docker:
- image: hafizalfaza/node-go-sqip
steps:
- run: node --version
- run: npm --version
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: npm install
- run: npm test
workflows:
version: 2
build_and_test:
jobs:
- test
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM circleci/node:8
RUN sudo wget https://dl.google.com/go/go1.12.linux-amd64.tar.gz
RUN sudo tar -xvf go1.12.linux-amd64.tar.gz
RUN sudo mv go /usr/local
ENV GOROOT=/usr/local/go
ENV PATH=$GOROOT/bin:$PATH
RUN go version
RUN node -v
6 changes: 3 additions & 3 deletions test/e2e/e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('cli api', () => {
expect($filter.attr('stdDeviation')).toBe('12')

// Check default number of primitives
const $primitives = $('svg g > *')
const $primitives = $('svg g > g > *')
expect($primitives).toHaveLength(8)
})
.unlink(outputFile)
Expand All @@ -74,7 +74,7 @@ describe('cli api', () => {
`sqip-e2e-test-${new Date().getTime()}.svg`
)
nixt()
.run(`${cliCmd} -i ${inputFile} -o ${outputFile} -n 15`)
.run(`${cliCmd} -i ${inputFile} -o ${outputFile} -n 15 -b 0`)
.code(0)
.exist(outputFile)
.expect(result => {
Expand Down Expand Up @@ -104,7 +104,7 @@ describe('cli api', () => {
const $ = cheerio.load(content, { xml: true })

// Check type of primitives to be all ellipses
const $primitives = $('svg g > *')
const $primitives = $('svg g > g > *')
const types = $primitives
.map((i, $primitive) => $primitive.tagName)
.get()
Expand Down

0 comments on commit 3d828d5

Please sign in to comment.