-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for config files and environment variables
- Loading branch information
Showing
24 changed files
with
422 additions
and
91 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
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
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
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
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,79 @@ | ||
Feature: Config Sources | ||
|
||
Scenario: Settings can be pulled from TOML configuration files | ||
Given I have a "public/index.html" file with the body: | ||
""" | ||
<h1>Hello.</h1> | ||
""" | ||
Given I have a "pagefind.toml" file with the content: | ||
""" | ||
source = "public" | ||
""" | ||
When I run my program | ||
Then I should see "Running Pagefind" in stdout | ||
Then I should see the file "public/_pagefind/pagefind.js" | ||
|
||
Scenario: Settings can be pulled from YAML configuration files | ||
Given I have a "public/index.html" file with the body: | ||
""" | ||
<h1>Hello.</h1> | ||
""" | ||
Given I have a "pagefind.yml" file with the content: | ||
""" | ||
source: public | ||
""" | ||
When I run my program | ||
Then I should see "Running Pagefind" in stdout | ||
Then I should see the file "public/_pagefind/pagefind.js" | ||
|
||
Scenario: Settings can be pulled from JSON configuration files | ||
Given I have a "public/index.html" file with the body: | ||
""" | ||
<h1>Hello.</h1> | ||
""" | ||
Given I have a "pagefind.json" file with the content: | ||
""" | ||
{ | ||
"source": "public" | ||
} | ||
""" | ||
When I run my program | ||
Then I should see "Running Pagefind" in stdout | ||
Then I should see the file "public/_pagefind/pagefind.js" | ||
|
||
Scenario: Settings can be pulled from commandline flags | ||
Given I have a "public/index.html" file with the body: | ||
""" | ||
<h1>Hello.</h1> | ||
""" | ||
When I run my program with the flags: | ||
| --source public | | ||
Then I should see "Running Pagefind" in stdout | ||
Then I should see the file "public/_pagefind/pagefind.js" | ||
|
||
Scenario: Settings can be pulled from environment variables | ||
Given I have a "public/index.html" file with the body: | ||
""" | ||
<h1>Hello.</h1> | ||
""" | ||
Given I have the environment variables: | ||
| PAGEFIND_SOURCE | public | | ||
When I run my program | ||
Then I should see "Running Pagefind" in stdout | ||
Then I should see the file "public/_pagefind/pagefind.js" | ||
|
||
Scenario: Settings can be pulled from multiple sources | ||
Given I have a "public/index.html" file with the body: | ||
""" | ||
<h1>Hello.</h1> | ||
""" | ||
Given I have a "pagefind.json" file with the content: | ||
""" | ||
{ | ||
"source": "public" | ||
} | ||
""" | ||
When I run my program with the flags: | ||
| --bundle-dir _out | | ||
Then I should see "Running Pagefind" in stdout | ||
Then I should see the file "public/_out/pagefind.js" |
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
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
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
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
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
@skip | ||
Feature: Index Chunking | ||
|
||
Background: | ||
Given I have the environment variables: | ||
| PAGEFIND_SOURCE | public | | ||
|
||
Scenario: Browser only loads chunks needed to search for the target word | ||
Scenario: Chunk size is configurable |
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
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
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
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
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
@skip | ||
Feature: Spellcheck | ||
|
||
Background: | ||
Given I have the environment variables: | ||
| PAGEFIND_SOURCE | public | | ||
|
||
Scenario: Spelling correction can be returned for the unique words in the dataset |
Oops, something went wrong.