Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from chanind/ci
Browse files Browse the repository at this point in the history
feat: setting up CI and semantic-release
  • Loading branch information
chanind authored Jun 13, 2019
2 parents 3fd9e83 + d42d3fa commit 3428105
Show file tree
Hide file tree
Showing 5 changed files with 2,606 additions and 90 deletions.
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:10

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- run: yarn lint
- run: yarn test
- run: if [ "$CIRCLE_BRANCH" = "master" ]; then yarn semantic-release; fi
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"dist": "npm run build",
"clean-dev": "gulp clean --develop",
"clean": "gulp clean",
"test": "jest ./test/* --silent --bail",
"coverage": "jest ./test/* --coverage --bail",
"test": "jest ./test/* ",
"coverage": "jest ./test/* --coverage",
"lint": "eslint \"src/**/*.js\"",
"lint-tools": "eslint \"tools/**/*.js\" --rule \"import/no-extraneous-dependencies: false\""
},
Expand Down Expand Up @@ -59,6 +59,7 @@
"gulp-sourcemaps": "^2.6.5",
"jest": "^23.5.0",
"miniprogram-simulate": "^1.0.0",
"semantic-release": "^15.13.16",
"through2": "^2.0.3",
"vinyl": "^2.2.0",
"webpack": "^4.29.5",
Expand All @@ -67,4 +68,4 @@
"dependencies": {
"hanzi-writer": "^2.0.2"
}
}
}
12 changes: 12 additions & 0 deletions test/hanzi-writer-view.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const _ = require('./utils')

test('render', async () => {
const componentId = _.load('hanzi-writer-view', 'comp');
const component = _.render(componentId, { width: 200, height: 200 });

const parent = document.createElement('parent-wrapper');
component.attach(parent);

expect(_.match(component.dom, '<wx-view class="comp--container" style="width: 200px; height: 200px;"><wx-canvas style="width: 200px; height: 200px;"></wx-canvas></wx-view>')).toBe(true);
});

15 changes: 0 additions & 15 deletions test/index.test.js

This file was deleted.

Loading

0 comments on commit 3428105

Please sign in to comment.