Skip to content

Commit

Permalink
Add support for MSW (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito authored Dec 6, 2024
1 parent 221e50c commit c4b8080
Show file tree
Hide file tree
Showing 12 changed files with 3,268 additions and 6,263 deletions.
10 changes: 10 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
"glob": "**/*",
"input": "public"
},
{
"glob": "mockServiceWorker.js",
"input": "src/mocks",
"output": "./"
},
"src/assets"
],
"styles": ["src/styles.scss"],
Expand Down Expand Up @@ -87,6 +92,11 @@
{
"glob": "**/*",
"input": "public"
},
{
"glob": "mockServiceWorker.js",
"input": "src/mocks",
"output": "./"
}
],
"styles": ["src/styles.scss"],
Expand Down
11 changes: 11 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ export default [
from: ['features', 'service', 'models'],
allow: [['model', { context: 'auth' }]],
},
// Mock module may only import models
{
from: ['mock'],
disallow: [['*', { context: '!model' }]],
message: 'Mock modules can only import models',
},
],
},
],
Expand Down Expand Up @@ -254,6 +260,11 @@ export default [
mode: 'folder',
capture: ['context'],
},
{
type: 'mock',
mode: 'folder',
pattern: 'src/mocks',
},
],
},
},
Expand Down
26 changes: 16 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"type": "module",
"private": true,
"dependencies": {
"@angular-eslint/eslint-plugin": "^18.4.2",
"@angular-eslint/template-parser": "^18.4.2",
"@angular-eslint/eslint-plugin": "^19.0.0",
"@angular-eslint/template-parser": "^19.0.0",
"@angular/animations": "^19.0.1",
"@angular/cdk": "^19.0.1",
"@angular/common": "^19.0.1",
Expand All @@ -44,14 +44,14 @@
"@angular/compiler-cli": "^19.0.1",
"@compodoc/compodoc": "^1.1.26",
"@eslint/markdown": "^6.2.1",
"@types/jasmine": "~5.1.4",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"angular-eslint": "19.0.0-alpha.4",
"@types/jasmine": "~5.1.5",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"angular-eslint": "^19.0.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.15.0",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-boundaries": "^5.0.1",
"eslint-plugin-jsdoc": "^50.6.0",
"eslint-plugin-prettier": "^5.2.1",
Expand All @@ -62,11 +62,17 @@
"karma-coverage": "~2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"msw": "^2.6.6",
"postcss": "^8.4.49",
"prettier": "3.3.3",
"prettier-plugin-tailwindcss": "^0.6.9",
"tailwindcss": "^3.4.15",
"tailwindcss": "^3.4.16",
"typescript": "~5.6.3",
"typescript-eslint": "^8.16.0"
"typescript-eslint": "^8.17.0"
},
"msw": {
"workerDirectory": [
"src/mocks"
]
}
}
Loading

0 comments on commit c4b8080

Please sign in to comment.