Skip to content

Commit

Permalink
Complete v3.0 testing fixes and integration
Browse files Browse the repository at this point in the history
Fix test run line

Bump latest node version back to 16

Attempt different run test strategy

Maybe this one won't fail

CI test run fixes

Fix incorrect npm script definition

Another test fix attempt

Attempt fix failing tests with sleep

Fix conditional bash statements

Should be final round of test fixes

Add BrowserStack + Coverage

Final fixes for coverage and browserstack

Tweaked browser CI config

Add status badges
  • Loading branch information
Nick Frasser committed Aug 17, 2021
1 parent 97a1fa0 commit f8f61b6
Showing 6 changed files with 28 additions and 14 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js CI
name: Continuous Integration

on:
push:
@@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [10.x, 12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
@@ -38,5 +38,13 @@ jobs:

- run: npm install
- run: bash test/setup.sh ${{ matrix.node-version }}
- run: bash run-tests.sh ${{ matrix.node-version }}
- run: npm run coverage
- run: bash test/run.sh ${{ matrix.node-version }}
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Linkify

[![npm version](https://badge.fury.io/js/linkifyjs.svg)](https://www.npmjs.com/package/linkifyjs)
[![Build Status](https://travis-ci.org/SoapBox/linkifyjs.svg)](https://travis-ci.org/SoapBox/linkifyjs)
[![Sauce Test Status](https://saucelabs.com/buildstatus/nfrasser)](https://saucelabs.com/u/nfrasser)
[![Coverage Status](https://coveralls.io/repos/SoapBox/linkifyjs/badge.svg?branch=master)](https://coveralls.io/r/SoapBox/linkifyjs?branch=master)

[![Sauce Test Status](https://app.saucelabs.com/browser-matrix/nfrasser.svg)](https://app.saucelabs.com/u/nfrasser)
[![CI](https://github.com/Soapbox/linkifyjs/actions/workflows/ci.yml/badge.svg)](https://github.com/Soapbox/linkifyjs/actions/workflows/ci.yml)
[![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=MEY1aklrOVlacVR3UFlQSXJ1cnd2Q3E4ckF3SWYwU1QwUTdhYlB2WHgxST0tLWcxUlhVckFiQUN3YkYrZHJQRHUyZ0E9PQ==--b974ce8f45b084b7e3a8eea67d8307971a829ab8)](https://automate.browserstack.com/public-build/MEY1aklrOVlacVR3UFlQSXJ1cnd2Q3E4ckF3SWYwU1QwUTdhYlB2WHgxST0tLWcxUlhVckFiQUN3YkYrZHJQRHUyZ0E9PQ==--b974ce8f45b084b7e3a8eea67d8307971a829ab8)
[![Coverage Status](https://coveralls.io/repos/github/Soapbox/linkifyjs/badge.svg?branch=master)](https://coveralls.io/github/Soapbox/linkifyjs?branch=master)

Linkify is a small yet comprehensive JavaScript plugin for finding URLs in plain-text and converting them to HTML links. It works with all valid URLs and email addresses.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
"dist": "run-s clean build copy",
"dist:ci": "run-s clean build:ci copy",
"lint": "eslint *.js packages/**/*.js test/**/*.js",
"test": "nyc --reporter=html --reporter=text mocha test/index.js",
"test": "nyc --reporter=lcov --reporter=text mocha test/index.js",
"test:ci": "karma start test/ci.conf.js --single-run",
"coverage": "nyc report --reporter=text-lcov | coveralls"
},
5 changes: 3 additions & 2 deletions test/ci.conf.js
Original file line number Diff line number Diff line change
@@ -45,9 +45,9 @@ module.exports = function (config) {
bs_android_8: {
base: 'BrowserStack',
os: 'android',
os_version: '8.0',
os_version: '9.0',
browser: 'android',
device: 'Google Pixel',
device: 'Google Pixel 3',
},
bs_android_11: {
base: 'BrowserStack',
@@ -79,6 +79,7 @@ module.exports = function (config) {
logLevel: config.LOG_WARN,

browserStack: {
project: 'linkifyjs',
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_ACCESS_KEY
},
4 changes: 3 additions & 1 deletion test/run.sh
Original file line number Diff line number Diff line change
@@ -7,14 +7,16 @@ set -e
# * The jQuery version is 1.*
# - so only a single member machine in the matrix calls sauce

if [[ $(echo $SAUCE_USERNAME) != "" && $(echo $1) == "16.x" ]]; then
if [[ "$BROWSERSTACK_ACCESS_KEY" != "" && "$BROWSERSTACK_USERNAME" != "" && "$1" == "16.x" ]]; then
# Run build, basic tests and SauceLabs tests
echo "Running complete test suite..."
npm test
npm run dist:ci
npm run test:ci
sleep 3 # Wait for threads to exit?
else
# Run basic tests
echo "Running basic tests..."
npm test
sleep 3 # Wait for threads to exit?
fi
7 changes: 6 additions & 1 deletion test/setup.sh
Original file line number Diff line number Diff line change
@@ -8,4 +8,9 @@ if [ "$1" == "16.x" ]; then
fi

echo "Installing jquery ${JQUERY_VERSION} and react ${REACT_VERSION}"
exec npm install --force jquery@~$JQUERY_VERSION react-dom@~$REACT_VERSION react@~$REACT_VERSION
npm install --force jquery@~$JQUERY_VERSION react-dom@~$REACT_VERSION react@~$REACT_VERSION

echo "Linking Node.js modules"
cd node_modules
ln -f -s ../packages/* .
cd ..

0 comments on commit f8f61b6

Please sign in to comment.