Skip to content

Commit

Permalink
Set up Vitest and added some tests (#337)
Browse files Browse the repository at this point in the history
* Added Vitest testing to about page

* Added tests for basic rendering on each major acmcsuf.com page

* Ran `npm run lint`

* Fixed all lint errors that came along with upgrading the sveltekit deps

* Added first group of tests for `/lib/ical/common`

* Update CONTRIBUTING.md

* Shorted npm run test to npm t in npm run all

* Removed unnecessary environment comment

* Added PR number to cache name

* Will this fix the lint errors?

* Update tsconfig.json

Recommended to wait on this <sveltejs/kit#4118 (comment)>

* Added Vitest testing to about page

* Added tests for basic rendering on each major acmcsuf.com page

* Ran `npm run lint`

* Fixed all lint errors that came along with upgrading the sveltekit deps

* Added first group of tests for `/lib/ical/common`

* Update CONTRIBUTING.md

* Shorted npm run test to npm t in npm run all

* Removed unnecessary environment comment

* Added PR number to cache name

* Will this fix the lint errors?

* Update tsconfig.json

* Ran `npm run format`

* Delete unused dep

* Imported `LoadInput` and `LoadOutput` from '@sveltejs/kit/types/internal' (for now)

* Upgraded dependencies again real quick

* Path parameters are always passed as string

* Resolved #337 (comment)

* Resolved <#337 (comment)>
  • Loading branch information
EthanThatOneKid committed Mar 17, 2022
1 parent 18cfb94 commit 45c858b
Show file tree
Hide file tree
Showing 54 changed files with 3,217 additions and 1,626 deletions.
11 changes: 1 addition & 10 deletions .eslintrc.cjs
@@ -1,8 +1,8 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
plugins: ['svelte3', '@typescript-eslint'],
env: { browser: true, node: true },
ignorePatterns: ['*.cjs'],
overrides: [
{ files: ['*.svelte'], processor: 'svelte3/svelte3' },
Expand All @@ -19,13 +19,4 @@ module.exports = {
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2019,
},
env: {
browser: true,
es2017: true,
node: true,
},
};
5 changes: 4 additions & 1 deletion .github/workflows/check_website.yaml
Expand Up @@ -34,7 +34,7 @@ jobs:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-node-${{ github.event.pull_request.number }}-
- name: Install Dependencies
run: npm ci
Expand All @@ -46,6 +46,9 @@ jobs:
- name: Check
run: npm run check

- name: Test
run: npm run test

# info: https://etok.codes/acmcsuf.com/blob/main/CONTRIBUTING.md#npm-bloat
- name: Test Dependency Size
run: npm run test:size
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Expand Up @@ -5,7 +5,7 @@
"printWidth": 100,
"svelteStrictMode": false,
"svelteAllowShorthand": true,
"svelteBracketNewLine": false,
"bracketSameLine": false,
"svelteIndentScriptAndStyle": true,
"svelteSortOrder": "scripts-options-markup-styles"
}
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Expand Up @@ -28,9 +28,10 @@ Before publishing a PR, it is recommended that you run a few commands to make su

```bash
npm run format # Careful, this command might mutate your files.
npm run lint --fix # Careful, this might mutate your files.
npm run lint # Careful, this might mutate your files.
npm run check # Use this command to find bugs in your website code.
npm run build # Use this to make sure your code builds successfully.
npm t # Run all our unit tests (or with `npm run test`)

# Or, run the following to check everything you'd normally want to check.
npm run all
Expand Down

1 comment on commit 45c858b

@vercel
Copy link

@vercel vercel bot commented on 45c858b Mar 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.