Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove integration tests #2153

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/main-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ jobs:
- name: Test Public Typings
run: yarn test:tsd

- name: Integration Testing
run: yarn test:integration

- name: E2E Testing
run: yarn test:e2e

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ jobs:
- name: Linting & Types
run: yarn lint:all

- name: Integration Testing
run: yarn test:integration

- name: Creates local .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

Expand Down
82 changes: 42 additions & 40 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@ This project and everyone participating in it are governed by the [Code of Condu

The documentation is based on [Docusaurus](https://docusaurus.io/) framework. Source inside the [website](https://github.com/lingui/js-lingui/tree/main/website) directory.

- Go to the `website` directory:
- Go to the `website` directory:

```sh
cd website
```

- Install dependencies:

```sh
yarn install
```
```sh
yarn install
```

- To build the docs, watch for changes and preview documentation locally at [http://localhost:3000/](http://localhost:3000/):

```sh
yarn start
```
```sh
yarn start
```

- It's also possible to run `yarn build` for single build. Incremental builds are much faster than the first one as only changed files are built.

- Please lint and validate the documentation before submitting any changes:

```sh
yarn lint
yarn checkFormat
```
```sh
yarn lint
yarn checkFormat
```

## Contributing the code

Expand Down Expand Up @@ -68,10 +68,6 @@ This project uses [yarn][yarninstall] package manager. Please follow [official][
yarn test
```

> **Note**
> If you are using an IDE to run test make sure to use the right Jest config.
> For unit tests use `-c jest.config.js`. Integration tests use build packages (created using `yarn release:build`) and config `-c jest.config.integration.js`. See [package.json](./package.json) for more info.

### Using development version in your project

After you successfully fix a bug or add a new feature, you most probably want to test it in a real-world project as soon as possible.
Expand All @@ -84,44 +80,50 @@ There are two documented ways to do this: first is a generic way described in th

1. Run `verdaccio` locally in docker (follow [verdaccio guide](https://verdaccio.org/docs/en/what-is-verdaccio.html) if you don't want to run it in Docker):

```sh
docker run -d -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
```
```sh
docker run -d -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
```

> Make sure that your verdaccio user is the same that appears in verdacio-release.js script.
> Make sure that your verdaccio user is the same that appears in verdacio-release.js script.

2. Publish local build of packages to registry. Run local release script:

```sh
yarn verdaccio:release
```
```sh
yarn verdaccio:release
```

3. If you enter inside http://0.0.0.0:4873 (verdaccio instance), you will see your packages published, so you're ready to install them.

4. Inside your project, run:

with NPM:
```sh
# Point to your local registry
npm config set registry http://0.0.0.0:4873/
# Run update-by-scope will update all @lingui packages
npx update-by-scope @lingui
```
with Yarn Classic (1.*):
```sh
yarn upgrade --scope @lingui --registry http://0.0.0.0:4873/ --latest
```
with Yarn Berry:
```sh
YARN_NPM_REGISTRY_SERVER=http://0.0.0.0:4873/ yarn up "@lingui/*"
```
with NPM:

```sh
# Point to your local registry
npm config set registry http://0.0.0.0:4873/
# Run update-by-scope will update all @lingui packages
npx update-by-scope @lingui
```

with Yarn Classic (1.\*):

```sh
yarn upgrade --scope @lingui --registry http://0.0.0.0:4873/ --latest
```

with Yarn Berry:

```sh
YARN_NPM_REGISTRY_SERVER=http://0.0.0.0:4873/ yarn up "@lingui/*"
```

5. After you make some changes, you need to run the same process. (Releasing + yarn upgrade)

6. When finished testing, restore default registry (only for NPM)

```sh
npm config set registry https://registry.npmjs.org/
```
```sh
npm config set registry https://registry.npmjs.org/
```

#### Testing changes using the React Native example

Expand Down
17 changes: 0 additions & 17 deletions jest.config.integration.js

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
"test": "jest",
"test:ci": "jest --ci --runInBand",
"test:ci:coverage": "yarn test:ci --coverage",
"test:integration": "yarn node --experimental-vm-modules $(yarn bin jest) -c jest.config.integration.js",
"test:e2e": "yarn workspaces foreach -p run test:e2e",
"test:tsd": "jest -c jest.config.types.js",
"test:all": "yarn test && yarn test:integration && yarn test:e2e && yarn test:tsd",
"test:all": "yarn test && yarn test:e2e && yarn test:tsd",
"lint:types": "tsc",
"lint:eslint": "eslint ./packages",
"lint:all": "yarn lint:eslint && yarn lint:types",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/macro/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,4 @@ export const msg: typeof defineMessage
/**
* Helps to define a name for a variable in the message
*/
export function ph(def: LabeledExpression): string
export function ph(def: LabeledExpression<string | number>): string
5 changes: 4 additions & 1 deletion packages/vite-plugin/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import path from "path"
import { exec as _exec } from "child_process"
import { mkdtempSync } from "fs"
import os from "os"
import { platform } from "node:os"

describe("vite-plugin", () => {
const skipOnWindows = platform() === "win32" ? describe.skip : describe

skipOnWindows("vite-plugin", () => {
it("should return compiled catalog", async () => {
const mod = await runVite(`po-format/vite.config.ts`)
expect((await mod.load()).messages).toMatchSnapshot()
Expand Down
Loading