Skip to content

Commit

Permalink
feat(test): test against multi versions of vue
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Apr 1, 2018
1 parent 9ce5436 commit 25d0b13
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 34 deletions.
111 changes: 83 additions & 28 deletions .circleci/config.yml
@@ -1,46 +1,101 @@
version: 2 version: 2

defaults: &defaults
working_directory: ~/project/bootstrap-vue
docker:
- image: banian/node

jobs: jobs:
build: setup:
working_directory: /usr/src/app <<: *defaults
docker:
- image: banian/node
steps: steps:
# Checkout repository
- checkout - checkout

# Restore cache
- restore_cache: - restore_cache:
key: yarn-{{ checksum "yarn.lock" }} key: yarn-{{ checksum "yarn.lock" }}

# Install dependencies
- run: - run:
name: Install Dependencies name: Install Dependencies
command: NODE_ENV=dev yarn command: NODE_ENV=dev yarn

# Keep cache
- save_cache: - save_cache:
key: yarn-{{ checksum "yarn.lock" }} key: yarn-{{ checksum "yarn.lock" }}
paths: paths:
- "node_modules" - "node_modules"
- persist_to_workspace:
root: ~/project
paths:
- bootstrap-vue


# Build lint:
- run: <<: *defaults
name: Build steps:
command: | - run:
mkdir -p dist name: Lint
yarn build command: yarn lint


# Test build:
- run: <<: *defaults
name: Tests steps:
command: yarn test -- --maxWorkers=2 --coverage && yarn codecov - run:
name: Build
command: yarn build


# Publish Docs test-latest:
- deploy: <<: *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 name: Publish Docs
command: | command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then git config --global user.email vuebootstrap@gmail.com
git config --global user.email vuebootstrap@gmail.com git config --global user.name BootstrapVue
git config --global user.name BootstrapVue yarn docs-gen && yarn docs-publish
yarn docs-gen && yarn docs-publish
fi 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
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -55,7 +55,7 @@
"docs-gen": "nuxt generate -c docs/nuxt.config.js", "docs-gen": "nuxt generate -c docs/nuxt.config.js",
"docs-build": "nuxt build -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", "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", "lint": "eslint src scripts docs tests nuxt",
"release": "npm run build && npm run test && standard-version", "release": "npm run build && npm run test && standard-version",
"postinstall": "opencollective postinstall || exit 0" "postinstall": "opencollective postinstall || exit 0"
Expand Down Expand Up @@ -106,7 +106,9 @@
"rollup-watch": "^4.3.1", "rollup-watch": "^4.3.1",
"standard-version": "^4.3.0", "standard-version": "^4.3.0",
"uglify-es": "^3.3.6", "uglify-es": "^3.3.6",
"vue-beta": "npm:vue@~2.5.17-beta.0",
"vue-jest": "^2.1.1", "vue-jest": "^2.1.1",
"vue-latest": "npm:vue@~2.5.16",
"vue-test-utils": "1.0.0-beta.11" "vue-test-utils": "1.0.0-beta.11"
}, },
"jest": { "jest": {
Expand Down
5 changes: 4 additions & 1 deletion tests/utils.js
@@ -1,8 +1,11 @@
import { readFileSync } from 'fs' import { readFileSync } from 'fs'
import { resolve } from 'path' import { resolve } from 'path'
import Vue from 'vue/dist/vue.common'
import BootstrapVue from '../src' 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 // Hide development mode warning
Vue.config.productionTip = false Vue.config.productionTip = false


Expand Down
12 changes: 8 additions & 4 deletions yarn.lock
Expand Up @@ -8798,6 +8798,10 @@ vue-analytics@^5.4.0:
version "5.9.1" version "5.9.1"
resolved "https://registry.yarnpkg.com/vue-analytics/-/vue-analytics-5.9.1.tgz#3ac9810f56dbe54bca4fd1c3ee42354b433d932b" resolved "https://registry.yarnpkg.com/vue-analytics/-/vue-analytics-5.9.1.tgz#3ac9810f56dbe54bca4fd1c3ee42354b433d932b"


"vue-beta@npm:vue@~2.5.17-beta.0":
version "2.5.17-beta.0"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.17-beta.0.tgz#b9985447818827306beee146923a1bd64f1bb834"

vue-eslint-parser@^2.0.3: vue-eslint-parser@^2.0.3:
version "2.0.3" version "2.0.3"
resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz#c268c96c6d94cfe3d938a5f7593959b0ca3360d1" resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz#c268c96c6d94cfe3d938a5f7593959b0ca3360d1"
Expand Down Expand Up @@ -8832,6 +8836,10 @@ vue-jest@^2.1.1:
tsconfig "^7.0.0" tsconfig "^7.0.0"
vue-template-es2015-compiler "^1.5.3" vue-template-es2015-compiler "^1.5.3"


"vue-latest@npm:vue@~2.5.16", vue@^2.5.16:
version "2.5.16"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.16.tgz#07edb75e8412aaeed871ebafa99f4672584a0085"

vue-loader@^15.0.0-beta.7: vue-loader@^15.0.0-beta.7:
version "15.0.0-beta.7" version "15.0.0-beta.7"
resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.0.0-beta.7.tgz#2066ea26a940eed1fd97d2751c6abf5282f87b54" resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.0.0-beta.7.tgz#2066ea26a940eed1fd97d2751c6abf5282f87b54"
Expand Down Expand Up @@ -8897,10 +8905,6 @@ vue-test-utils@1.0.0-beta.11:
dependencies: dependencies:
lodash "^4.17.4" lodash "^4.17.4"


vue@^2.5.16:
version "2.5.16"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.16.tgz#07edb75e8412aaeed871ebafa99f4672584a0085"

vuex@^3.0.1: vuex@^3.0.1:
version "3.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.0.1.tgz#e761352ebe0af537d4bb755a9b9dc4be3df7efd2" resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.0.1.tgz#e761352ebe0af537d4bb755a9b9dc4be3df7efd2"
Expand Down

0 comments on commit 25d0b13

Please sign in to comment.