Skip to content

Commit

Permalink
ci: run tests against windows as well (#837)
Browse files Browse the repository at this point in the history
* ci: run tests against windows as well

* ci: skip linting on windows

* ci: run lint separately (so as not to block other tests)

* test: adapt re for windows

* add gitattrs for text files using lf

* disable conflict test for now

Co-authored-by: Pooya Parsa <pyapar@gmail.com>
  • Loading branch information
danielroe and pi0 committed Jan 16, 2023
1 parent 04937d5 commit f16e4de
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.txt text eol=lf
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ on:
- main

jobs:
ci:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -23,6 +22,23 @@ jobs:
cache: pnpm
- run: pnpm install
- run: pnpm lint

ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: pnpm
- run: pnpm install
- run: pnpm test:types
- run: pnpm build
- run: pnpm vitest --coverage
Expand Down
3 changes: 2 additions & 1 deletion test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { listen, Listener } from "listhen";
import destr from "destr";
import { fetch } from "ofetch";
import { expect, it, afterAll } from "vitest";
import { isWindows } from "std-env";
import { fileURLToPath } from "mlly";
import { joinURL } from "ufo";
import * as _nitro from "../src";
Expand Down Expand Up @@ -197,7 +198,7 @@ export function testNitro(
it("universal import.meta", async () => {
const { status, data } = await callHandler({ url: "/api/import-meta" });
expect(status).toBe(200);
expect(data.testFile).toMatch(/\/test.txt$/);
expect(data.testFile).toMatch(/[/\\]test.txt$/);
expect(data.hasEnv).toBe(true);
});

Expand Down

0 comments on commit f16e4de

Please sign in to comment.