Skip to content

Commit

Permalink
Merge pull request #1102 from microsoft/chore/change-test-framework
Browse files Browse the repository at this point in the history
chore: change to vitest and remove cjs bundling.
  • Loading branch information
koros authored May 9, 2024
2 parents c291a67 + 19470c8 commit ce491de
Show file tree
Hide file tree
Showing 336 changed files with 17,414 additions and 18,062 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
*.js.map
*.d.ts

node_modules
dist
node_modules/
dist/
72 changes: 41 additions & 31 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
module.exports = {
"env": {
"browser": true,
"es2021": true,
"node": true
env: {
browser: true,
es6: true,
node: true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
extends: ['@microsoft/eslint-config-msgraph'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: [
'packages/abstractions/tsconfig.json',
'packages/authentication/azure/tsconfig.json',
'packages/authentication/azure/tsconfig.json',
'packages/http/fetch/tsconfig.json',
'packages/serialization/form/tsconfig.json',
'packages/serialization/json/tsconfig.json',
'packages/serialization/multipart/tsconfig.json',
'packages/authentication/azure/tsconfig.json',
'packages/test/tsconfig.json'
],
sourceType: 'module'
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/consistent-type-imports": "error"
plugins: ['eslint-plugin-jsdoc', 'eslint-plugin-prefer-arrow', 'eslint-plugin-react', '@typescript-eslint', 'header'],
root: true,
ignorePatterns: ['.eslintrc.js', '*.mjs'],
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'prefer-arrow/prefer-arrow-functions': 'warn',
// prefer-nullish-coalescing requires strictNullChecking to be turned on
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'header/header': [
2,
'block',
[
'*',
' * -------------------------------------------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.',
' * See License in the project root for license information.',
' * -------------------------------------------------------------------------------------------',
' '
],
1
]
}
}
};
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,7 @@ updates:
eslint:
patterns:
- "*eslint*"
vitest:
patterns:
- "*vitest*"

5 changes: 2 additions & 3 deletions .github/workflows/build_test_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
shell: pwsh
working-directory: ./
- run: npm ci
- run: npm install -g [email protected]
- run: npm run build
- name: Archive dist folders # archive dist folders to verify if they are transpiled correctly and available for publishing
uses: actions/upload-artifact@v4
Expand All @@ -40,14 +39,14 @@ jobs:
packages/serialization/text/dist
packages/http/fetch/dist
packages/authentication/azure/dist
- run: npx lerna run test:integrated
- run: npm run test:integrated
if: ${{env.TENANT_ID != '' }}
env:
TENANT_ID: ${{secrets.tenant_id}}
CLIENT_ID: ${{secrets.client_id}}
CLIENT_SECRET: ${{secrets.client_secret}}
USER_ID: "813956a3-4a30-4596-914f-bfd86a657a09"
- run: npx lerna run test --parallel
- run: npm run test

publish-npm:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'auto dependabot')}}
Expand Down
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/scripts
packages/**/*/lib/
packages/**/*.js
packages/**/*.js.map
packages/**/*.d.ts
Loading

0 comments on commit ce491de

Please sign in to comment.