Skip to content

Commit

Permalink
chore: ci debug
Browse files Browse the repository at this point in the history
  • Loading branch information
narol1024 committed Jun 1, 2024
1 parent e6b1f22 commit 4fcf4e2
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
with:
node-version: 16
- run: npm install
- run: npm run test:coverage
- run: npm run test:ci
- name: Update Coverage Badge
# GitHub actions: default branch variable
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: we-cli/coverage-badge-action@main

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SDP-Analyzer

[![cov](https://narol1024.github.io/sdp-analyzer/badges/coverage.svg)](https://github.com/narol1024/sdp-analyzer/actions)

An analyzer to implement the SDP (Stable Dependencies Principle) theory. You can quickly analyze your npm package here: https://narol.pro/sdp-analyzer

![](https://narol-blog.oss-cn-beijing.aliyuncs.com/blog-img/202405202249324.png)
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
},
__JEST_TEST_ENV__: true,
},
collectCoverageFrom: ['<rootDir>/src/*.ts'],
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
coveragePathIgnorePatterns: ['<rootDir>/dist/', '/node_modules/', '<rootDir>/scripts', '<rootDir>/tools'],
coverageProvider: 'v8',
coverageReporters: isCI ? ['json'] : ['text'],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build:clean": "rm -rf tsconfig.build.tsbuildinfo && rm -rf ./dist",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"test:coverage": "npm run test -- --coverage",
"test:ci": "npm run test -- --colors --coverage --ci",
"test:ci": "npm run test -- --colors --coverage --ci reporter=json-summary",
"lint": "eslint --ext .ts,.js .",
"format": "prettier \"./**\" --write --ignore-unknown",
"format:check": "prettier \"./**\" --ignore-unknown --check"
Expand Down
80 changes: 80 additions & 0 deletions src/platforms/workspaces/yarn/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Workspaces Test should be that the package.json can be found 1`] = `
Array [
Object {
"dependencies": Object {},
"name": "a",
},
Object {
"dependencies": Object {
"a": "^1.0.0",
},
"name": "b",
},
Object {
"dependencies": Object {
"a": "^1.0.0",
"b": "^1.0.0",
},
"name": "c",
},
Object {
"dependencies": Object {
"a": "^1.0.0",
"b": "^1.0.0",
"c": "^1.0.0",
},
"name": "d",
},
Object {
"dependencies": Object {
"a": "^1.0.0",
"b": "^1.0.0",
"c": "^1.0.0",
"e": "^1.0.0",
},
"name": "e",
},
]
`;

exports[`Workspaces Test should return a dep tree 1`] = `
Array [
Object {
"fanIn": 1,
"fanOut": 0,
"instable": 0,
"label": "Stable",
"name": "a",
},
Object {
"fanIn": 1,
"fanOut": 1,
"instable": 0.5,
"label": "Normal",
"name": "b",
},
Object {
"fanIn": 1,
"fanOut": 2,
"instable": 0.6666666666666666,
"label": "Flexible",
"name": "c",
},
Object {
"fanIn": 1,
"fanOut": 3,
"instable": 0.75,
"label": "Flexible",
"name": "d",
},
Object {
"fanIn": 1,
"fanOut": 4,
"instable": 0.8,
"label": "Instable",
"name": "e",
},
]
`;
11 changes: 11 additions & 0 deletions src/utils/utis.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* This is a sample test suite.
* Replace this with your implementation.
*/
import { isLocalPath } from './checkLocalPath';

describe('Utils Test', () => {
it('should be false using invalid path', () => {
expect(isLocalPath('./error-path')).toEqual(false);
});
});

0 comments on commit 4fcf4e2

Please sign in to comment.