Skip to content

Commit

Permalink
feat(test): adding testing library for make user course in application (
Browse files Browse the repository at this point in the history
#111)

* feat(mocks): adding mocks for development mode

* feat(jest): adding more test

* feat(connection): adding connection mock and fetch request mocjing

* feat(connection): adding test for connection to github

* feat(test): adding unit testing in skizzle
  • Loading branch information
Debaerdm authored Jul 30, 2021
1 parent f18c3ff commit 128234c
Show file tree
Hide file tree
Showing 85 changed files with 12,832 additions and 4,069 deletions.
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking'
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
extraFileExtensions: ['.svelte']
},
env: {
es6: true,
browser: true
},
overrides: [
{
files: ['*.svelte'],
processor: 'svelte3/svelte3'
}
],
settings: {
'svelte3/typescript': require('typescript')
},
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['node_modules']
}
88 changes: 66 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,70 @@
name: Build/release

on:
push:
tags:
- 'v*'
# on:
# push:
# tags:
# - 'v*'
on: push

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 12
- name: Build/release Skizzle
uses: samuelmeuli/action-electron-builder@v1
with:
github_token: ${{ secrets.github_token }}
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: npm install
- name: Test electron application
run: npm build
build:
if: github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master'
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: npm install
- name: Prepare for app notarization
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
github_token: ${{ secrets.github_token }}
release: true
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}
# windows_certs: ${{ secrets.windows_certs }}
# windows_certs_password: ${{ secrets.windows_certs_password }}
env:
API_KEY_ID: ${{ secrets.api_key_id }}
API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }}

# - name: Send Windows store verification
# if: startsWith(matrix.os, 'windows')
# run: "echo 'This is currently disabled. Help needed!'"
# run: ./tasks/win-store-build.cmd

# - name: Build/release Skizzle
# uses: samuelmeuli/action-electron-builder@v1
# with:
# github_token: ${{ secrets.github_token }}
# release: ${{ startsWith(github.ref, 'refs/tags/v') }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ dist
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vscode
.vscode

mockServiceWorker.js
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

12 changes: 12 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
arrowParens: 'avoid',
singleQuote: true,
printWidth: 90,
plugins: ['prettier-plugin-svelte'],
semi: false,
svelteSortOrder: 'options-styles-scripts-markup',
svelteStrictMode: false,
svelteBracketNewLine: true,
svelteIndentScriptAndStyle: true,
trailingComma: 'none'
}
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
"presets": [
["@babel/preset-env", { "targets": { "node": "current" } }]
]
};
3 changes: 3 additions & 0 deletions dev-app-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
owner: AxaGuilDEv
repo: Skizzle
provider: github
42 changes: 42 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const esModules = ["svelte-highlight"].join("|")

module.exports = {
testEnvironment: 'jsdom',
setupFiles: ['jest-localstorage-mock'],
verbose: true,
testMatch: ["**/__tests__/**/*.+(ts|tsx|js)", "**/?(*.)+(spec).+(ts|tsx|js)"],
clearMocks: true,
transform: {
"^.+\\.(js|mjs)$": "babel-jest",
"^.+\\.ts$": "ts-jest",
"^.+\\.svelte$": [
"svelte-jester",
{
"preprocess": true
}
],
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
},
moduleDirectories: ["src","node_modules"],
moduleFileExtensions: [
"js",
"mjs",
"ts",
"svelte"
],
coverageDirectory: "coverage",
coverageReporters: ["json", "lcov", "text", "clover", "html"],
collectCoverageFrom: [
"src/**/*.js",
"src/**/*.svelte",
"src/**/*.ts",
"!src/tests/**/*"
],
coverageProvider: "babel",
coveragePathIgnorePatterns: [
".*\\.d\\.ts"
],
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
bail: false,
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect', './src/setupTests.ts']
};
Loading

0 comments on commit 128234c

Please sign in to comment.