Skip to content

Commit

Permalink
WIP - tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mkacmar committed Sep 30, 2024
1 parent d435fec commit d3ae5ec
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 49 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/node-version-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Node.js integration

on:
push:
branches: [main]
branches: [main, dev/martinkamar/tests]
pull_request:
branches: [main]

Expand All @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [18.x, 20.x, 22.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v4
Expand All @@ -26,4 +26,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npx eslint --version
- run: npx mocha --version
- run: npx tsc --version
- run: node --version
- run: npm test
1 change: 1 addition & 0 deletions lib/rules/no-cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
const fullTypeChecker = astUtils.getFullTypeChecker(context);
return {
"MemberExpression[property.name='cookie']"(node) {
console.log(node.object);
if (astUtils.isDocumentObject(node.object, context, fullTypeChecker)) {
context.report({
node: node,
Expand Down
88 changes: 44 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"eslint-plugin-security": "1.4.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "~8.6.0",
"@typescript-eslint/parser": "~8.6.0",
"@typescript-eslint/eslint-plugin": "~8.8.0",
"@typescript-eslint/parser": "~8.8.0",
"eslint": "~9.11.0",
"mocha": "~10.7.0",
"typescript": "~5.5.0"
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/rules/no-cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ namespace Sample {
}
}
`,
errors: [{ messageId: "doNotUseCookies" }]
errors: [{ messageId: "doNotUseCookies" }],
only: true
}
]
});

0 comments on commit d3ae5ec

Please sign in to comment.