diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..db83de4 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,46 @@ +aliases: + - &install_yarn_version + name: Install specific Yarn version + command: | + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0 + echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV + + - &restore_yarn_cache + name: Restore Yarn cache + keys: + - yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }} + + - &save_yarn_cache + name: Save Yarn cache + key: yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }} + paths: + - ~/.cache/yarn + + - &run_yarn_install + name: Install dependencies + command: yarn install + +defaults: &defaults + working_directory: ~/instantsearch-e2-tests + docker: + - image: circleci/node:10.16.3@sha256:6ab62742cec4a68e75e7cac063f6549bae0bcfd0541700df7fde54765eed4ad2 + +version: 2 +jobs: + test: + <<: *defaults + steps: + - checkout + - run: *install_yarn_version + - restore_cache: *restore_yarn_cache + - run: *run_yarn_install + - save_cache: *save_yarn_cache + - run: + name: Test specs + command: yarn test:saucelabs + +workflows: + version: 2 + ci: + jobs: + - test diff --git a/.eslintignore b/.eslintignore index c2658d7..7b132aa 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ node_modules/ +tests/ diff --git a/.gitignore b/.gitignore index da4a2ad..b926b69 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ node_modules/ npm-debug.log yarn-error.log .DS_Store +tests/* +!tests/*.sh diff --git a/package.json b/package.json index c26cede..45755b4 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,9 @@ "scripts": { "commit": "git-cz", "version": "conventional-changelog --preset angular --infile CHANGELOG.md --same-file && git add CHANGELOG.md", + "test": "yarn test:local", + "test:local": "yarn link && cd tests && ./instantsearch.js.sh && ./react-instantsearch.sh && ./vue-instantsearch.sh", + "test:saucelabs": "SAUCELABS=1 yarn test:local", "lint": "eslint --ext .js,.ts,.tsx .", "lint:fix": "eslint --ext .js,.ts,.tsx --fix .", "type-check": "tsc", diff --git a/tests/instantsearch.js.sh b/tests/instantsearch.js.sh new file mode 100755 index 0000000..9bcafc8 --- /dev/null +++ b/tests/instantsearch.js.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e + +rm -rf instantsearch.js +git clone git@github.com:algolia/instantsearch.js.git --branch develop --depth=1 +cd instantsearch.js +yarn --ignore-engines +yarn link instantsearch-e2e-tests +yarn run website:build +if [ "$SAUCELABS" ]; then + yarn run test:e2e:saucelabs +else + yarn run test:e2e +fi diff --git a/tests/react-instantsearch.sh b/tests/react-instantsearch.sh new file mode 100755 index 0000000..90c6f14 --- /dev/null +++ b/tests/react-instantsearch.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e + +rm -rf react-instantsearch +git clone git@github.com:algolia/react-instantsearch.git --branch master --depth=1 +cd react-instantsearch +yarn --ignore-engines +yarn link instantsearch-e2e-tests +yarn run website:build +if [ "$SAUCELABS" ]; then + yarn run test:e2e:saucelabs +else + yarn run test:e2e +fi diff --git a/tests/vue-instantsearch.sh b/tests/vue-instantsearch.sh new file mode 100755 index 0000000..f39368a --- /dev/null +++ b/tests/vue-instantsearch.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e + +rm -rf vue-instantsearch +git clone git@github.com:algolia/vue-instantsearch.git --branch master --depth=1 +cd vue-instantsearch +yarn --ignore-engines +yarn link instantsearch-e2e-tests +yarn run examples:build +if [ "$SAUCELABS" ]; then + yarn run test:e2e:saucelabs +else + yarn run test:e2e +fi diff --git a/tsconfig.json b/tsconfig.json index 716bb0e..161c298 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,6 @@ "noFallthroughCasesInSwitch": true, "allowSyntheticDefaultImports": true, "types": ["node", "webdriverio", "jasmine"] - } + }, + "exclude": ["node_modules", "tests"] }