Skip to content

Commit

Permalink
fix: refactor testing structure
Browse files Browse the repository at this point in the history
  • Loading branch information
erincgucer committed Sep 6, 2024
1 parent 8bdbc79 commit 69e5fc7
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 19 deletions.
22 changes: 22 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,25 @@ yarn = "1.22.22"
description = "Clean the test directory"
dir = "test"
run = ["git clean -xdf"]

[tasks.buildtest]
description = 'Build the Test templates'
run = """
#!/usr/bin/env bash
cd tests
for dir in ./*/ ; do
(cd "$dir" && /home/runner/work/stencil-templatemodule/stencil-templatemodule/stencil);
done
"""

[tasks.runtest]
description = 'Run the tests'
## <<Stencil::Block(runTests)>>
env = {ENV_VAR_NAME = 'hooray'} # env vars for the script
run = """
#!/usr/bin/env bash
echo "Tests are running"
"""
## <</Stencil::Block>>


6 changes: 0 additions & 6 deletions .mise/tasks/buildtest.sh

This file was deleted.

3 changes: 0 additions & 3 deletions .mise/tasks/runtest.sh

This file was deleted.

26 changes: 26 additions & 0 deletions templates/.mise.toml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,29 @@ yarn = "1.22.22"
description = "Clean the test directory"
dir = "test"
run = ["git clean -xdf"]

[tasks.buildtest]
description = 'Build the Test templates'
run = """
#!/usr/bin/env bash
cd tests
for dir in ./*/ ; do
(cd "$dir" && /home/runner/work/{{ .Config.Name }}/{{ .Config.Name }}/stencil);
done
"""

[tasks.runtest]
description = 'Run the tests'
## <<Stencil::Block(runTests)>>
{{- if (empty (file.Block "runTests")) }}
env = {ENV_VAR_NAME = 'hooray'} # env vars for the script
run = """
#!/usr/bin/env bash
echo "Tests are running"
"""
{{- else }}
{{ file.Block "runTests" }}
{{- end }}
## <</Stencil::Block>>


6 changes: 0 additions & 6 deletions templates/.mise/tasks/buildtest.sh.tpl

This file was deleted.

4 changes: 0 additions & 4 deletions templates/.mise/tasks/runtest.sh.tpl

This file was deleted.

0 comments on commit 69e5fc7

Please sign in to comment.