-
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.
- Loading branch information
Showing
7 changed files
with
214 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: ["main", "library-rework"] | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ${{matrix.os}} | ||
defaults: | ||
run: | ||
shell: bash | ||
strategy: | ||
matrix: | ||
include: | ||
- build: linux | ||
os: ubuntu-latest | ||
rust: beta | ||
target: x86_64-unknown-linux-musl | ||
cross: false | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Install | ||
run: npm i | ||
|
||
- name: Unit Test | ||
run: npm run test | ||
|
||
- name: Behavior Test | ||
run: ./test_ci.sh |
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
cd $SCRIPT_DIR | ||
|
||
GADGET_CLI=$(realpath "$SCRIPT_DIR/src/cli.js") | ||
|
||
npx -y toolproof --placeholders gadget_cli="$GADGET_CLI" |
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
cd $SCRIPT_DIR | ||
|
||
GADGET_CLI=$(realpath "$SCRIPT_DIR/src/cli.js") | ||
|
||
npx -y toolproof --placeholders gadget_cli="$GADGET_CLI" --all -i |
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,74 @@ | ||
name: Text Example 1 | ||
|
||
steps: | ||
- step: I have a ".eleventy.js" file with the content {js} | ||
js: |- | ||
const pluginRss = require("@11ty/eleventy-plugin-rss"); | ||
module.exports = function (eleventyConfig) { | ||
eleventyConfig.setUseGitIgnore(false); | ||
eleventyConfig.setDataDeepMerge(true); | ||
eleventyConfig.addCollection('nav', function (collectionApi) { | ||
return collectionApi.getAll() | ||
.filter((page) => page.data.show_in_navigation === true) | ||
.sort((a, b) => a.data.navigation_order - b.data.navigation_order); | ||
}); | ||
eleventyConfig.addPassthroughCopy('images'); | ||
eleventyConfig.addPlugin(pluginRss); | ||
}; | ||
- step: I have a "pages/index.njk" file with the content {njk} | ||
njk: |- | ||
--- | ||
title: | ||
call_to_action: Contact | ||
permalink: / | ||
--- | ||
<div class="editable"> | ||
<p>This is the <strong>Justice</strong> template from <a href="https://cloudcannon.com/">CloudCannon</a>. Justice is strong foundation for the web presence of a law firm or business. It's filled with fictitious example content to get you started.</p> | ||
<p>Justice Law is professional representation. Practicing for over 50 years, our team have the knowledge and skills to get you results.</p> | ||
</div> | ||
- step: I have a "staff-members/jane-doe.md" file with the content {md} | ||
md: |- | ||
--- | ||
_uuid: 05589684-8d33-4d2f-8fde-460f9922d319 | ||
name: Jane Doe | ||
image: "https://placekitten.com/440/440?a=.png" | ||
description: Jane has 19 years of experience in law, and specialises in property and business. | ||
credentials: LLB | ||
phone_extension: "02" | ||
--- | ||
- step: I have a "staff-members/john-doe.md" file with the content {md} | ||
md: |- | ||
--- | ||
_uuid: 8c6c132e-1c21-413e-be81-874091df1841 | ||
name: John Doe | ||
image: "https://placebear.com/440/440?a=.png" | ||
description: With an interest in employment law, John works tirelessly to improve workplaces. | ||
credentials: LLB | ||
phone_extension: "11" | ||
--- | ||
- I run "node %gadget_cli% ." | ||
- stdout should contain "eleventy" | ||
- snapshot: stdout | ||
snapshot_content: |- | ||
╎{ | ||
╎ "ssg": "eleventy", | ||
╎ "source": "", | ||
╎ "collections_config": { | ||
╎ "pages": { | ||
╎ "path": "", | ||
╎ "name": "Pages", | ||
╎ "icon": "wysiwyg", | ||
╎ "filter": { | ||
╎ "base": "strict" | ||
╎ } | ||
╎ } | ||
╎ }, | ||
╎ "paths": { | ||
╎ "collections": "" | ||
╎ } | ||
╎} |
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,38 @@ | ||
name: Demo Test with Refs | ||
|
||
steps: | ||
- ref: ./eleventy_config.toolproof.yml | ||
- ref: ./staff_collection.toolproof.yml | ||
- step: I have a "pages/index.njk" file with the content {njk} | ||
njk: |- | ||
--- | ||
title: | ||
call_to_action: Contact | ||
permalink: / | ||
--- | ||
<div class="editable"> | ||
<p>This is the <strong>Justice</strong> template from <a href="https://cloudcannon.com/">CloudCannon</a>. Justice is strong foundation for the web presence of a law firm or business. It's filled with fictitious example content to get you started.</p> | ||
<p>Justice Law is professional representation. Practicing for over 50 years, our team have the knowledge and skills to get you results.</p> | ||
</div> | ||
- I run "node %gadget_cli% ." | ||
- stdout should contain "eleventy" | ||
- snapshot: stdout | ||
snapshot_content: |- | ||
╎{ | ||
╎ "ssg": "eleventy", | ||
╎ "source": "", | ||
╎ "collections_config": { | ||
╎ "pages": { | ||
╎ "path": "", | ||
╎ "name": "Pages", | ||
╎ "icon": "wysiwyg", | ||
╎ "filter": { | ||
╎ "base": "strict" | ||
╎ } | ||
╎ } | ||
╎ }, | ||
╎ "paths": { | ||
╎ "collections": "" | ||
╎ } | ||
╎} |
22 changes: 22 additions & 0 deletions
22
toolproof_tests/refs_example/eleventy_config.toolproof.yml
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,22 @@ | ||
name: 11ty Config Setup | ||
type: reference | ||
|
||
steps: | ||
- step: I have a ".eleventy.js" file with the content {js} | ||
js: |- | ||
const pluginRss = require("@11ty/eleventy-plugin-rss"); | ||
module.exports = function (eleventyConfig) { | ||
eleventyConfig.setUseGitIgnore(false); | ||
eleventyConfig.setDataDeepMerge(true); | ||
eleventyConfig.addCollection('nav', function (collectionApi) { | ||
return collectionApi.getAll() | ||
.filter((page) => page.data.show_in_navigation === true) | ||
.sort((a, b) => a.data.navigation_order - b.data.navigation_order); | ||
}); | ||
eleventyConfig.addPassthroughCopy('images'); | ||
eleventyConfig.addPlugin(pluginRss); | ||
}; |
24 changes: 24 additions & 0 deletions
24
toolproof_tests/refs_example/staff_collection.toolproof.yml
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,24 @@ | ||
name: Staff Collection Setup | ||
type: reference | ||
|
||
steps: | ||
- step: I have a "staff-members/jane-doe.md" file with the content {md} | ||
md: |- | ||
--- | ||
_uuid: 05589684-8d33-4d2f-8fde-460f9922d319 | ||
name: Jane Doe | ||
image: "https://placekitten.com/440/440?a=.png" | ||
description: Jane has 19 years of experience in law, and specialises in property and business. | ||
credentials: LLB | ||
phone_extension: "02" | ||
--- | ||
- step: I have a "staff-members/john-doe.md" file with the content {md} | ||
md: |- | ||
--- | ||
_uuid: 8c6c132e-1c21-413e-be81-874091df1841 | ||
name: John Doe | ||
image: "https://placebear.com/440/440?a=.png" | ||
description: With an interest in employment law, John works tirelessly to improve workplaces. | ||
credentials: LLB | ||
phone_extension: "11" | ||
--- |