Skip to content

Commit

Permalink
test(command-dev): replace cra test with eleventy test
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah committed Apr 19, 2021
1 parent d74d294 commit e17985e
Show file tree
Hide file tree
Showing 34 changed files with 6,796 additions and 15,709 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"test:ci": "run-s test:init:* test:ci:*",
"test:init:cli-version": "npm run start -- --version",
"test:init:cli-help": "npm run start -- --help",
"test:init:install-deps": "npm ci --prefix tests/site-cra",
"test:init:install-deps": "npm ci --prefix tests/eleventy-site",
"test:dev:ava": "ava --verbose",
"test:ci:ava": "nyc -r json ava",
"docs": "node ./site/scripts/docs.js",
Expand Down
3 changes: 3 additions & 0 deletions tests/eleventy-site/.eleventy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy({ _redirects: '_redirects' })
}
2 changes: 2 additions & 0 deletions tests/eleventy-site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_site/
node_modules/
4 changes: 2 additions & 2 deletions tests/site-cra/_redirects → tests/eleventy-site/_redirects
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/force.html /test.html 200!
/something /otherthing.html
/force /test 200!
/something /otherthing
/api/* /.netlify/functions/:splat 200
/* /index.html 200
File renamed without changes.
7 changes: 7 additions & 0 deletions tests/eleventy-site/functions/echo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// eslint-disable-next-line require-await
const handler = async (event) => ({
statusCode: 200,
body: JSON.stringify(event),
})

module.exports = { handler }
9 changes: 9 additions & 0 deletions tests/eleventy-site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Eleventy Site</title>
</head>
<body>
<p>Eleventy Site</p>
</body>
</html>
2 changes: 2 additions & 0 deletions tests/eleventy-site/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[functions]
directory = "functions"
File renamed without changes.
Loading

0 comments on commit e17985e

Please sign in to comment.