Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the JS test runner #367

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ env:
jobs:
test:
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}
# TODO find a different setup for the JS testsuite as phantomjs is abandoned and is not available on newer runner images
runs-on: 'ubuntu-20.04'
runs-on: 'ubuntu-latest'
continue-on-error: ${{ matrix.allowed-to-fail }}

strategy:
Expand Down Expand Up @@ -44,7 +43,7 @@ jobs:
symfony-version: latest
steps:
- name: "Checkout code"
uses: actions/checkout@v2.3.3
uses: actions/checkout@v4.1.7

- name: "Install PHP with extensions"
uses: shivammathur/[email protected]
Expand Down Expand Up @@ -77,8 +76,23 @@ jobs:
- name: "Run unit tests"
run: vendor/bin/phpunit --coverage-text --verbose

- name: "Run phantomjs tests"
run: phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index.html
test_js:
name: JS tests
runs-on: ubuntu-latest

- name: "Run phantomjs tests ES5"
run: phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index-with-es5-shim.html
steps:
- name: "Checkout code"
uses: actions/[email protected]

- name: "Setup node"
uses: actions/[email protected]
with:
node-version: 'lts/*'

- name: "Install dependencies"
run: npm install
working-directory: Resources

- name: "Run tests"
run: npm test
working-directory: Resources
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
vendor/
composer.lock
package-lock.json
.phpunit.result.cache
18 changes: 0 additions & 18 deletions Resources/js/index-with-es5-shim.html

This file was deleted.

8 changes: 3 additions & 5 deletions Resources/js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
<head>
<meta charset="utf-8">
<title>ExposeTranslationBundle Unit Tests</title>
<script src="libs/jquery-1.6.1.min.js"></script>
<script src="libs/qunit/qunit.js"></script>
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=Intl,Intl.~locale.fr,Intl.PluralRules.~locale.fr,Intl.PluralRules,Number.isFinite"></script>
<script src="https://unpkg.com/[email protected]/dist/umd/intl-messageformat.min.js"></script>
<script src="../node_modules/qunit/qunit/qunit.js"></script>
<script src="../node_modules/intl-messageformat/intl-messageformat.iife.js"></script>
<script src="translator.js"></script>
<script src="translatorTest.js"></script>
<link rel="stylesheet" href="./libs/qunit/qunit.css">
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
</head>
<body>
<div id="qunit"></div>
Expand Down
Loading
Loading