-
Notifications
You must be signed in to change notification settings - Fork 5
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
12 changed files
with
3,173 additions
and
92 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,14 @@ | ||
name: Syntax and Linting | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
run-tests: | ||
name: Run unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Run Tests | ||
run: yarn 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
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,19 @@ | ||
const Strapi = require('strapi'); | ||
const http = require('http'); | ||
|
||
let instance; | ||
|
||
async function setupStrapi() { | ||
if (!instance) { | ||
/** the following code in copied from `./node_modules/strapi/lib/Strapi.js` */ | ||
await Strapi().load(); | ||
instance = strapi; // strapi is global now | ||
await instance.app | ||
.use(instance.router.routes()) // populate KOA routes | ||
.use(instance.router.allowedMethods()); // populate KOA methods | ||
|
||
instance.server = http.createServer(instance.app.callback()); | ||
} | ||
return instance; | ||
} | ||
module.exports = { setupStrapi }; |
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,12 @@ | ||
const util = require('../../api/helpers/util'); | ||
|
||
describe('Test Slugify', () => { | ||
it('should return slugify version of a string', () => { | ||
const string = 'nyala dev'; | ||
expect(util.slugify(string)).toBe('nyala-dev'); | ||
}); | ||
it('should return slugify version of an arabicstring', () => { | ||
const string = 'الاسطورة خالد'; | ||
expect(util.slugify(string)).toBe('الاسطورة-خالد'); | ||
}); | ||
}); |
Oops, something went wrong.