forked from showdownjs/showdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: implement karma and browserstack tests
- Loading branch information
Showing
19 changed files
with
2,292 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: 'BrowserStack Test' | ||
on: | ||
push: | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ master, develop ] | ||
jobs: | ||
ubuntu-job: | ||
name: 'BrowserStack Test on Ubuntu' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: 'BrowserStack Env Setup' # Invokes the setup-env action | ||
uses: browserstack/github-actions/setup-env@master | ||
with: | ||
username: ${{ secrets.BROWSERSTACK_USERNAME }} | ||
access-key: ${{ secrets.BROWSERSTACK_ACCESSKEY }} | ||
|
||
- name: 'BrowserStack Local Tunnel Setup' # Invokes the setup-local action | ||
uses: browserstack/github-actions/setup-local@master | ||
with: | ||
local-testing: start | ||
local-identifier: random | ||
|
||
# The next 3 steps are for building the web application to be tested and starting the web server on the runner environment | ||
|
||
- name: 'Checkout the repository' | ||
uses: actions/checkout@v2 | ||
|
||
- name: '🚚 Upgrade NPM' | ||
run: npm install -g npm | ||
|
||
- name: 'Use Node.js 17.x' | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 17.x | ||
cache: 'npm' | ||
|
||
- name: 'Concatenate src files for testing' | ||
run: grunt concat:test | ||
|
||
- name: 'Running test on BrowserStack with Karma' | ||
run: karma start karma.browserstack.js | ||
|
||
- name: 'BrowserStackLocal Stop' # Terminating the BrowserStackLocal tunnel connection | ||
uses: browserstack/github-actions/setup-local@master | ||
with: | ||
local-testing: stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
node_modules | ||
npm-debug.log | ||
/*.test.* | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ dist/**/*.js | |
build/**/*.js | ||
src/options.js | ||
bin/* | ||
/karma.browserstack.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
module.exports = function (config) { | ||
config.set({ | ||
// global config of your BrowserStack account | ||
browserStack: { | ||
username: process.env.BROWSERSTACK_USERNAME, | ||
accessKey: process.env.BROWSERSTACK_ACCESSKEY | ||
}, | ||
|
||
// define browsers | ||
customLaunchers: { | ||
bstack_chrome_windows: { | ||
base: 'BrowserStack', | ||
browser: 'chrome', | ||
browser_version: '72.0', | ||
os: 'Windows', | ||
os_version: '10' | ||
}, | ||
bstack_firefox_windows: { | ||
base: 'BrowserStack', | ||
browser: 'firefox', | ||
browser_version: '98.0', | ||
os: 'Windows', | ||
os_version: '10' | ||
}, | ||
//dropped support for IE 10 | ||
bstack_ie10_windows: { | ||
base: 'BrowserStack', | ||
browser: 'ie', | ||
browser_version: '10', | ||
os: 'Windows', | ||
os_version: '7' | ||
}, | ||
//dropped support for IE 10 | ||
bstack_ie11_windows: { | ||
base: 'BrowserStack', | ||
browser: 'ie', | ||
browser_version: '11', | ||
os: 'Windows', | ||
os_version: '10' | ||
}, | ||
bstack_iphoneX: { | ||
base: 'BrowserStack', | ||
browser: 'safari', | ||
device: 'iPhone X', | ||
os: 'ios', | ||
real_mobile: true, | ||
os_version: '11.0' | ||
} | ||
}, | ||
|
||
browsers: ['bstack_chrome_windows', 'bstack_firefox_windows', 'bstack_ie11_windows', 'bstack_iphoneX'], | ||
frameworks: ['mocha', 'chai'], | ||
reporters: ['dots', 'BrowserStack'], | ||
files: [ | ||
{ pattern: '.build/showdown.js'}, | ||
{ pattern: 'src/options.js'}, | ||
// tests | ||
{ pattern: 'test/unit/showdown*.js' }, | ||
{ pattern: 'test/functional/showdown*.js' }, | ||
], | ||
singleRun: true, | ||
concurrency: Infinity | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = function (config) { | ||
config.set({ | ||
client: { | ||
captureConsole: true | ||
}, | ||
browserConsoleLogOptions: { | ||
level: 'log', | ||
format: '%b %T: %m', | ||
terminal: true | ||
}, | ||
logLevel: config.LOG_LOG, | ||
frameworks: ['mocha', 'chai'], | ||
files: [ | ||
{ pattern: '.build/showdown.js'}, | ||
{ pattern: 'src/options.js'}, | ||
// tests | ||
{ pattern: 'test/unit/showdown*.js' }, | ||
{ pattern: 'test/functional/showdown*.js' }, | ||
], | ||
reporters: ['progress'], | ||
port: 9876, // karma web server port | ||
colors: true, | ||
browsers: ['ChromeHeadless', 'FirefoxHeadless', 'jsdom'], | ||
autoWatch: false, | ||
singleRun: true, // Karma captures browsers, runs the tests and exits | ||
//concurrency: Infinity, | ||
customLaunchers: { | ||
'FirefoxHeadless': { | ||
base: 'Firefox', | ||
flags: [ | ||
'-headless', | ||
] | ||
} | ||
}, | ||
}); | ||
}; |
Oops, something went wrong.