Skip to content

Commit

Permalink
test: add smoke test to make sure that plugin is loaded properly
Browse files Browse the repository at this point in the history
  • Loading branch information
zackad committed Nov 10, 2024
1 parent 16330e4 commit 79e390f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ jobs:

- name: Run Test
run: yarn test

- name: Run smoke test
run: yarn test-smoke
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Internals
- Test with Node.js 22, current active lts version
- Add smoke test to make sure that the plugin can be loaded properly

---
## 0.9.1 (2024-10-10)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
],
"scripts": {
"lint": "DEBUG=eslint:cli-engine eslint .",
"test": "vitest --run"
"test": "vitest --run",
"test-smoke": "prettier --check --parser=twig --plugin=./src/index.js tests/smoke-test.twig"
},
"dependencies": {
"@babel/template": "^7.24.7",
Expand Down
30 changes: 30 additions & 0 deletions tests/smoke-test.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>
Document
</title>
</head>
<body>
<ul id="navigation">
{% for item in navigation %}
<li><a href="{{ item.href }}">{{ item.caption }}</a></li>
{% endfor %}
</ul>

<h1>
My Webpage
</h1>
{{ a_variable }}
{% set name = 'Fabien' %}
{% set numbers = [1, 2] %}
{% set map = {
city: 'Paris'
} %}
{{ data|convert_encoding(from = 'iso-2022-jp', to = 'UTF-8') }}
</body>
</html>

0 comments on commit 79e390f

Please sign in to comment.