Permalink
Browse files

feat(test): test against multi versions of vue

  • Loading branch information...
pi0 committed Apr 1, 2018
1 parent 9ce5436 commit 25d0b13fc78a24349a9cee5b3916a97bfe71f641
Showing with 98 additions and 34 deletions.
  1. +83 −28 .circleci/config.yml
  2. +3 −1 package.json
  3. +4 −1 tests/utils.js
  4. +8 −4 yarn.lock
@@ -1,46 +1,101 @@
version: 2
defaults: &defaults
working_directory: ~/project/bootstrap-vue
docker:
- image: banian/node
jobs:
build:
working_directory: /usr/src/app
docker:
- image: banian/node
setup:
<<: *defaults
steps:
# Checkout repository
- checkout
# Restore cache
- restore_cache:
key: yarn-{{ checksum "yarn.lock" }}
# Install dependencies
- run:
name: Install Dependencies
command: NODE_ENV=dev yarn
# Keep cache
- save_cache:
key: yarn-{{ checksum "yarn.lock" }}
paths:
- "node_modules"
- persist_to_workspace:
root: ~/project
paths:
- bootstrap-vue
# Build
- run:
name: Build
command: |
mkdir -p dist
yarn build
lint:
<<: *defaults
steps:
- run:
name: Lint
command: yarn lint
# Test
- run:
name: Tests
command: yarn test -- --maxWorkers=2 --coverage && yarn codecov
build:
<<: *defaults
steps:
- run:
name: Build
command: yarn build
# Publish Docs
- deploy:
test-latest:
<<: *defaults
steps:
- attach_workspace:
at: ~/project
- run:
name: Test
command: yarn test --maxWorkers=2 --coverage && yarn codecov
environment:
- VUE_VERSION: "latest"
test-beta:
<<: *defaults
steps:
- attach_workspace:
at: ~/project
- run:
name: Test
command: yarn test --maxWorkers=2 --coverage && yarn codecov
environment:
- VUE_VERSION: "beta"
docs:
<<: *defaults
steps:
- run:
name: Publish Docs
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
git config --global user.email vuebootstrap@gmail.com
git config --global user.name BootstrapVue
yarn docs-gen && yarn docs-publish
fi
git config --global user.email vuebootstrap@gmail.com
git config --global user.name BootstrapVue
yarn docs-gen && yarn docs-publish
workflows:
version: 2
setup-and-parallel-test:
jobs:
- setup
- lint:
requires:
- setup
- build:
requires:
- setup
- test-latest:
requires:
- setup
- test-beta:
requires:
- setup
- docs:
requires:
- build
filters:
branches:
only:
- master
@@ -55,7 +55,7 @@
"docs-gen": "nuxt generate -c docs/nuxt.config.js",
"docs-build": "nuxt build -c docs/nuxt.config.js",
"docs-publish": "gh-pages -t -d docs-dist -b master -r git@github.com:bootstrap-vue/bootstrap-vue.github.io.git",
"test": "yarn lint && NODE_ENV=test jest",
"test": "jest",
"lint": "eslint src scripts docs tests nuxt",
"release": "npm run build && npm run test && standard-version",
"postinstall": "opencollective postinstall || exit 0"
@@ -106,7 +106,9 @@
"rollup-watch": "^4.3.1",
"standard-version": "^4.3.0",
"uglify-es": "^3.3.6",
"vue-beta": "npm:vue@~2.5.17-beta.0",
"vue-jest": "^2.1.1",
"vue-latest": "npm:vue@~2.5.16",
"vue-test-utils": "1.0.0-beta.11"
},
"jest": {
@@ -1,8 +1,11 @@
import { readFileSync } from 'fs'
import { resolve } from 'path'
import Vue from 'vue/dist/vue.common'
import BootstrapVue from '../src'
const VUE_VERSION = process.env.VUE_VERSION ? 'vue-' + process.env.VUE_VERSION : 'vue'
const Vue = require(`${VUE_VERSION}/dist/vue.common`)
// Hide development mode warning
Vue.config.productionTip = false

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 25d0b13

Please sign in to comment.