Skip to content

Commit

Permalink
workaround rename package for npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
vpiyachinda committed Feb 19, 2024
1 parent 5bcde5d commit 82a492f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ An npm package that publishes test results object from testResultsProcessor(eg.

Firstly, client will need to install Test Results Collector package

```npm install --save-dev @agoda-com/test-metrics```
```npm install --save-dev agoda-test-metrics```

Next, user will require to add `testResultsProcessor` key to jest config

`testResultsProcessor: '@agoda-com/test-metrics'`
`testResultsProcessor: 'agoda-test-metrics'`

Note: Jest config could be in either **package.json** OR **standalone file** (jest.config.js).

Expand All @@ -38,13 +38,13 @@ If there is jest section in `package.json`, simply add:
```{
"name": "my-project",
"jest": {
"testResultsProcessor": "@agoda-com/test-metrics",
"testResultsProcessor": "agoda-test-metrics",
}
}
```
or if there is `jest.config.js`, simply add:

```"testResultsProcessor": "@agoda-com/test-metrics"```
```"testResultsProcessor": "agoda-test-metrics"```

## API

Expand Down Expand Up @@ -95,7 +95,7 @@ After that, the data will be processed on API (and then this can be able to inje

For testing, the idea is you can publish the beta version in the `release-beta` job on CI, and install the desired version to your repository using following command

` npm install @agoda-com/test-metrics@<<beta version>> --force`
` npm install agoda-test-metrics@<<beta version>> --force`

if the version is not updated, delete node_modules folder and reinstall

Expand Down
2 changes: 1 addition & 1 deletion doc/PLAYWRIGHT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
In case your client package.json has playwright like this
```
"devDependencies": {
"@agoda-com/test-metrics": "0.0.20",
"agoda-test-metrics": "0.0.21",
"@axe-core/playwright": "^4.4.5",
"@playwright/test": "^1.30.1",
"dotenv": "^16.0.1",
Expand Down
2 changes: 1 addition & 1 deletion doc/VITEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This package also supports collecting the test data of projects that are using V
If you use **Vitest**, you can add the following to your `vitest.config.js` file:

```javascript
import { VitestTestDataPlugin } from '@agoda-com/test-metrics'
import { VitestTestDataPlugin } from 'agoda-test-metrics'

export default defineConfig({
...,
Expand Down
2 changes: 1 addition & 1 deletion doc/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const junit: ReporterDescription = [
: path.join(__dirname,'playwright-report/junit.results.xml')
}
]
const testMetrics: ReporterDescription = ['@agoda-com/test-metrics/playwright']
const testMetrics: ReporterDescription = ['agoda-test-metrics/playwright']
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@agoda-com/test-metrics",
"name": "agoda-test-metrics",
"description": "Library to collect test metrics",
"version": "0.0.21",
"repository": "https://github.com/agoda-com/testresults-collector.git",
Expand Down
2 changes: 1 addition & 1 deletion src/jest/publishJestMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function publishJestMetrics(result: any) {
}).then(_ => {
console.log(`Jest Test results successfully posted to ${JEST_TESTDATA_API_URL}`);
}).catch(error => {
console.error(`Failed posting Jest test Results to ${JEST_TESTDATA_API_URL} from @agoda-com/test-metrics`);
console.error(`Failed posting Jest test Results to ${JEST_TESTDATA_API_URL} from agoda-test-metrics`);
});
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion src/playwright/publishPlaywrightMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PublishLocalPlaywrightMetrics implements Reporter {
});
console.log(`Playwright Test results from ${this.junitOutputFile} successfully posted to ${PLAYWRIGHT_TESTDATA_API_URL}`);
} catch (error) {
console.error(`Failed posting Playwright test Results - ${this.junitOutputFile} to ${PLAYWRIGHT_TESTDATA_API_URL} from @agoda-com/test-metrics`);
console.error(`Failed posting Playwright test Results - ${this.junitOutputFile} to ${PLAYWRIGHT_TESTDATA_API_URL} from agoda-test-metrics`);
}
}
}
Expand Down

0 comments on commit 82a492f

Please sign in to comment.