Skip to content

Commit

Permalink
chore: Apply prettier formatting (#13)
Browse files Browse the repository at this point in the history
- Matching config from other projects
  • Loading branch information
twk3 authored Oct 1, 2024
1 parent e080023 commit a0ec4c3
Show file tree
Hide file tree
Showing 124 changed files with 1,382 additions and 1,385 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
root: true,
// This tells ESLint to load the config from the package `eslint-config-custom`
extends: ["custom"],
extends: ['custom'],
};
8 changes: 4 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ on:
type: choice
description: Package to publish
options:
- "@currents/cmd"
- "@currents/jest"
- '@currents/cmd'
- '@currents/jest'

jobs:
publish:
Expand All @@ -35,8 +35,8 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- run: npm ci
- name: Publish to NPM
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ on:
jobs:
currentsUnitTests:
if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: "Unit Tests"
name: 'Unit Tests'
runs-on: ubuntu-22.04
container: mcr.microsoft.com/playwright:v1.28.1-focal
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: |
Expand Down
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ Run `npx currents api --help` to see all available api commands.

To explore additional examples and filtering options for receiving runs, you can utilize the `npx currents api get-run --help` command.


### Caching artifacts

The `currents cache` command allows you to archive files from specified locations and save them under an ID in Currents storage. It also stores a meta file with configuration data. You can provide the ID manually or it can be generated based on CI environment variables (only GitHub and GitLab are supported). The files to archive can be defined using the `paths <path-1,path2,...,path-n>` CLI option or predefined using a `preset`.
Expand Down
10 changes: 5 additions & 5 deletions examples/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript',
],
};
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
};
10 changes: 5 additions & 5 deletions examples/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
const config = {
reporters: [
// "default",
["@currents/jest", {}],
['@currents/jest', {}],
],
projects: [
{
displayName: "spec",
displayName: 'spec',
testLocationInResults: true,
testMatch: ["<rootDir>/**/*.spec.ts"],
testMatch: ['<rootDir>/**/*.spec.ts'],
},
{
displayName: "test",
displayName: 'test',
testLocationInResults: true,
testMatch: ["<rootDir>/**/*.test.ts"],
testMatch: ['<rootDir>/**/*.test.ts'],
},
],
};
Expand Down
14 changes: 7 additions & 7 deletions examples/src/basic/basic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
describe("describe block 1", () => {
it("expect 1 to match 1", () => {
describe('describe block 1', () => {
it('expect 1 to match 1', () => {
expect(1).toBe(1);
});

it.todo("todo test");
it.todo('todo test');

it.skip("skipped test case", () => {
it.skip('skipped test case', () => {
expect(2).toBe(2);
});
});

describe.skip("skipped describe block", () => {
it("expect 3 to match 3", () => {
describe.skip('skipped describe block', () => {
it('expect 3 to match 3', () => {
expect(3).toBe(3);
});

it("expect 4 to match 4", () => {
it('expect 4 to match 4', () => {
expect(4).toBe(4);
});
});
14 changes: 7 additions & 7 deletions examples/src/basic/basic2.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
describe("describe parent", () => {
describe("describe block 3", () => {
it("expect 1 to match 1", () => {
describe('describe parent', () => {
describe('describe block 3', () => {
it('expect 1 to match 1', () => {
expect(1).toBe(1);
});

it("expect 2 to match 2", () => {
it('expect 2 to match 2', () => {
expect(2).toBe(2);
});
});

describe("describe block 4", () => {
it("expect 3 to match 3", () => {
describe('describe block 4', () => {
it('expect 3 to match 3', () => {
expect(3).toBe(3);
});

it("expect 4 to match 4", () => {
it('expect 4 to match 4', () => {
expect(4).toBe(4);
});
});
Expand Down
4 changes: 2 additions & 2 deletions examples/src/basic/delay.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe("delay", () => {
test("example test", async () => {
describe('delay', () => {
test('example test', async () => {
await new Promise((resolve) => setTimeout(resolve, 2000));
expect(true).toBe(true);
});
Expand Down
4 changes: 2 additions & 2 deletions examples/src/basic/sum.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sum } from "./sum";
import { sum } from './sum';

test("adds 1 + 2 to equal 3", () => {
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
4 changes: 2 additions & 2 deletions examples/src/basic/sum.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function sum(a, b) {
return a + b;
}
return a + b;
}
6 changes: 3 additions & 3 deletions examples/src/flaky.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
jest.retryTimes(2);
let j = 0;
describe("Flaky", () => {
it("should pass only on second run", async () => {
describe('Flaky', () => {
it('should pass only on second run', async () => {
expect(j++).toEqual(1);
});

it("AAA", async () => {
it('AAA', async () => {
expect(1).toEqual(1);
});
});
8 changes: 4 additions & 4 deletions examples/src/same-title.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
jest.retryTimes(2);

describe("Test cases with same title", () => {
describe('Test cases with same title', () => {
let j = 0;

test("Test case example", () => {
test('Test case example', () => {
expect(j++).toBe(2);
});

test.skip("Test case example", () => {
test.skip('Test case example', () => {
expect(1).toBe(1);
});

test("Test case example", () => {
test('Test case example', () => {
expect(1).toBe(1);
});
});
4 changes: 2 additions & 2 deletions examples/src/skipped/skipped.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe.skip("skipped block", () => {
it("test inside skipped block", () => {
describe.skip('skipped block', () => {
it('test inside skipped block', () => {
expect(1).toBe(1);
}, 5000);
});
4 changes: 2 additions & 2 deletions examples/src/sum.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sum } from "./sum";
import { sum } from './sum';

test("[failed] adds 1 + 2 to equal 3", () => {
test('[failed] adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(4);
});
4 changes: 2 additions & 2 deletions examples/src/sum.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function sum(a, b) {
return a + b;
}
return a + b;
}
6 changes: 3 additions & 3 deletions examples/src/tag.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe("Test with @tag", () => {
test("Test A @tagA", () => {
describe('Test with @tag', () => {
test('Test A @tagA', () => {
expect(1).toBe(1);
});

test.skip("Test B @tagB", () => {
test.skip('Test B @tagB', () => {
expect(1).toBe(1);
});
});
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --parallel",
"lint": "turbo run lint"
"lint": "turbo run lint",
"format": "prettier --check .",
"format-fix": "prettier --write ."
},
"devDependencies": {
"eslint-config-custom": "*",
Expand Down
19 changes: 7 additions & 12 deletions packages/cmd/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,38 @@

## [1.0.5](https://github.com/currents-dev/currents-reporter/compare/@currents/cmd-v1.0.4...${npm.name}-v1.0.5) (2024-09-09)


### Bug Fixes

* make missing config variables user-friendly ([2a2b7ab](https://github.com/currents-dev/currents-reporter/commit/2a2b7abb97cbf78546465538d7c48b97d6934bc4))
- make missing config variables user-friendly ([2a2b7ab](https://github.com/currents-dev/currents-reporter/commit/2a2b7abb97cbf78546465538d7c48b97d6934bc4))

## [1.0.4](https://github.com/currents-dev/currents-reporter/compare/@currents/cmd-v1.0.3...${npm.name}-v1.0.4) (2024-09-03)


### Bug Fixes

* use .currents directory ([611132b](https://github.com/currents-dev/currents-reporter/commit/611132b286403fce4dcbf4343d82e9927611255d))
* use currents instead of currents-reporter CLI command ([2617004](https://github.com/currents-dev/currents-reporter/commit/26170046044f94dffda5bc967f2ab87a72cc0d8c))
- use .currents directory ([611132b](https://github.com/currents-dev/currents-reporter/commit/611132b286403fce4dcbf4343d82e9927611255d))
- use currents instead of currents-reporter CLI command ([2617004](https://github.com/currents-dev/currents-reporter/commit/26170046044f94dffda5bc967f2ab87a72cc0d8c))

## [1.0.3](https://github.com/currents-dev/currents-reporter/compare/@currents/cmd-v1.0.2...${npm.name}-v1.0.3) (2024-08-01)


### Bug Fixes

* use v1/runs endpoint [CSR-1336] ([#6](https://github.com/currents-dev/currents-reporter/issues/6)) ([d9a799d](https://github.com/currents-dev/currents-reporter/commit/d9a799dbcfa4db5908a2a168ce78adc544df45b5))
- use v1/runs endpoint [CSR-1336] ([#6](https://github.com/currents-dev/currents-reporter/issues/6)) ([d9a799d](https://github.com/currents-dev/currents-reporter/commit/d9a799dbcfa4db5908a2a168ce78adc544df45b5))

## [1.0.2](https://github.com/currents-dev/currents-reporter/compare/@currents/cmd-v1.0.1...${npm.name}-v1.0.2) (2024-07-25)


### Bug Fixes

* filter irrelevant options from jest configuration ([#5](https://github.com/currents-dev/currents-reporter/issues/5)) ([3031b3d](https://github.com/currents-dev/currents-reporter/commit/3031b3d78a394b0946daa1fd3ce4d2b73c32f9f3))
- filter irrelevant options from jest configuration ([#5](https://github.com/currents-dev/currents-reporter/issues/5)) ([3031b3d](https://github.com/currents-dev/currents-reporter/commit/3031b3d78a394b0946daa1fd3ce4d2b73c32f9f3))

## [1.0.1](https://github.com/currents-dev/currents-reporter/compare/@currents/cmd-v1.0.0...${npm.name}-v1.0.1) (2024-07-23)

# [1.0.0](https://github.com/currents-dev/currents-reporter/compare/@currents/cmd-v1.0.0-beta.4...${npm.name}-v1.0.0) (2024-07-16)

# [1.0.0-beta.4](https://github.com/currents-dev/currents-reporter/compare/@currents/cmd-v1.0.0-beta.3...${npm.name}-v1.0.0-beta.4) (2024-07-16)


### Bug Fixes

* include test case location in the report, when available ([#3](https://github.com/currents-dev/currents-reporter/issues/3)) ([f074021](https://github.com/currents-dev/currents-reporter/commit/f074021627ba44d130abeea0d608edf71440840a))
- include test case location in the report, when available ([#3](https://github.com/currents-dev/currents-reporter/issues/3)) ([f074021](https://github.com/currents-dev/currents-reporter/commit/f074021627ba44d130abeea0d608edf71440840a))

# [1.0.0-beta.3](https://github.com/currents-dev/currents-reporter/compare/@currents/cmd-v1.0.0-beta.2...${npm.name}-v1.0.0-beta.3) (2024-07-10)

Expand All @@ -62,4 +57,4 @@
### Features

- add reportDir option to jest-reporter ([887fae6](https://github.com/currents-dev/currents-reporter/commit/887fae637f5d08243323e30abedba919075939b6))
- add vitest ([2b25624](https://github.com/currents-dev/currents-reporter/commit/2b2562410adcce06de4e54abcc63c4a16603d27b))
- add vitest ([2b25624](https://github.com/currents-dev/currents-reporter/commit/2b2562410adcce06de4e54abcc63c4a16603d27b))
4 changes: 3 additions & 1 deletion packages/cmd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ For more examples and usage options, run `npx currents api --help`.

## Cache test artifacts

The `currents cache` command allows you to archive files from specified locations and save them under an ID in Currents storage. It also stores a meta file with configuration data. You can provide the ID manually or it can be generated based on CI environment variables (only GitHub and GitLab are supported).
The `currents cache` command allows you to archive files from specified locations and save them under an ID in Currents storage. It also stores a meta file with configuration data. You can provide the ID manually or it can be generated based on CI environment variables (only GitHub and GitLab are supported).

To cache files, use the following command:

```sh
npx currents cache set --key <record-key> --id <id> --paths <path-1,path-2,...path-n>
```

To download files, use the following command:

```sh
npx currents cache set --key <record-key> --preset last-run
```
Expand Down
20 changes: 10 additions & 10 deletions packages/cmd/publish.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#!/usr/bin/env node

const { execSync } = require("child_process");
const fs = require("fs");
const pkg = require("./package.json");
const { Command } = require("commander");
const { execSync } = require('child_process');
const fs = require('fs');
const pkg = require('./package.json');
const { Command } = require('commander');

const program = new Command()
.name("publish")
.option("-t, --tag <alpha | beta | latest>", "npm dist-tag to publish to");
.name('publish')
.option('-t, --tag <alpha | beta | latest>', 'npm dist-tag to publish to');

program.parse(process.argv);
const options = program.opts();

console.log(options);
if (!options.tag) {
console.log("No tag supplied: beta or latest");
console.log('No tag supplied: beta or latest');
process.exit(1);
}
console.log(process.cwd());
// fs.copyFileSync("./CHANGELOG.md", "./CHANGELOG.md");
fs.copyFileSync("../../LICENSE.md", "./LICENSE.md");
fs.copyFileSync('../../LICENSE.md', './LICENSE.md');
execSync(`npm pack --dry-run && npm publish --tag ${options.tag}`, {
cwd: "./",
stdio: "inherit",
cwd: './',
stdio: 'inherit',
});
Loading

0 comments on commit a0ec4c3

Please sign in to comment.