-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/AElfProject/docs-cms into f…
…eature/css
- Loading branch information
Showing
9 changed files
with
2,799 additions
and
432 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 |
---|---|---|
|
@@ -19,6 +19,7 @@ on: | |
- aelf-docs-dev | ||
- aefinder-docs-dev | ||
- tomorrowdao-docs-dev | ||
- tomorrowdao-docs-prod | ||
|
||
jobs: | ||
build: | ||
|
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,32 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# GitHub recommends pinning actions to a commit SHA. | ||
# To get a newer version, you will need to update the SHA. | ||
# You can also reference a tag or branch, but the action may change without warning. | ||
|
||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
|
||
- run: npm install | ||
- run: npm test |
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,42 @@ | ||
import { describe, it, expect } from "vitest"; | ||
import { convertArrToUrl } from "./url"; // Adjust the import path as necessary | ||
|
||
describe("convertArrToUrl", () => { | ||
it("should return an empty string if the input is not an array", () => { | ||
expect(convertArrToUrl("not an array" as any)).toBe(""); | ||
}); | ||
|
||
it("should return a slugified string", () => { | ||
const input = ["Hello", "World"]; | ||
const expected = "hello-world"; | ||
expect(convertArrToUrl(input)).toBe(expected); | ||
}); | ||
|
||
it("should handle special characters correctly", () => { | ||
const input = ["Hello!", "World?"]; | ||
const expected = "hello-world"; | ||
expect(convertArrToUrl(input)).toBe(expected); | ||
}); | ||
|
||
it("should replace 'c#' with 'csharp'", () => { | ||
const input = ["c#", "programming"]; | ||
const expected = "csharp-programming"; | ||
expect(convertArrToUrl(input)).toBe(expected); | ||
}); | ||
|
||
it("should handle an empty array", () => { | ||
expect(convertArrToUrl([])).toBe(""); | ||
}); | ||
|
||
it("should convert the array to a lowercase slug", () => { | ||
const input = ["Hello", "World"]; | ||
const expected = "hello-world"; | ||
expect(convertArrToUrl(input)).toBe(expected); | ||
}); | ||
|
||
it("should trim the result", () => { | ||
const input = [" Hello ", " World "]; | ||
const expected = "hello-world"; | ||
expect(convertArrToUrl(input)).toBe(expected); | ||
}); | ||
}); |
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,9 @@ | ||
server { | ||
listen 8080; | ||
root /usr/share/nginx/html; | ||
port_in_redirect off; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
Oops, something went wrong.