Skip to content

Commit

Permalink
github workflows: added JS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 24, 2023
1 parent 1c1be8e commit b84bca0
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 7 deletions.
File renamed without changes.
9 changes: 9 additions & 0 deletions .github/workflows/coding-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:

- run: composer create-project nette/coding-standard temp/coding-standard ^3 --no-progress
- run: php temp/coding-standard/ecs check src tests


eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npx eslint src/assets/netteForms.js
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,13 @@ jobs:
- env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php php-coveralls.phar --verbose --config tests/.coveralls.yml


jasmine:
name: JavaScript tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
#- run: npm install -g grunt-cli
- run: npm install --prefix tests/netteForms
- run: grunt --gruntfile=tests/netteForms/Gruntfile.js test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/vendor
/composer.lock
node_modules
package-lock.json
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"repository": {
"type": "git",
"url": "git+https://github.com/nette/forms.git"
},
"devDependencies": {
"eslint": "^8.52.0"
}
}
2 changes: 1 addition & 1 deletion tests/netteForms/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function(grunt) {
}
});

grunt.loadNpmTasks('grunt-contrib-jasmine');
require('load-grunt-tasks')(grunt);

grunt.registerTask('test', [
'jasmine'
Expand Down
3 changes: 2 additions & 1 deletion tests/netteForms/SpecRunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
<script src="node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
<script src="node_modules/jasmine-core/lib/jasmine-core/boot0.js"></script>
<script src="node_modules/jasmine-core/lib/jasmine-core/boot1.js"></script>
<script src="node_modules/js-fixtures/fixtures.js"></script>

<script src="../../src/assets/netteForms.js"></script>
Expand Down
10 changes: 5 additions & 5 deletions tests/netteForms/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"devDependencies": {
"eslint": "^7.4.0",
"grunt": "^1.2.1",
"grunt-contrib-jasmine": "^2.2.0",
"jasmine": "^3.5.0",
"js-fixtures": "^1.5.3"
"grunt": "^1.6.1",
"grunt-contrib-jasmine": "^4.0.0",
"jasmine": "^5.1.0",
"js-fixtures": "^1.5.3",
"load-grunt-tasks": "^5.1.0"
}
}

0 comments on commit b84bca0

Please sign in to comment.