diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4451503 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +name: CI +on: + push: + branches: [main, master] + pull_request: +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20, 22] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm install --no-audit --no-fund + - run: npm test diff --git a/LICENSE b/LICENSE index 481c289..05b804b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2026 NickCirv +Copyright (c) 2026 Nicholas Ashkar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index 57d6b96..ffa3c28 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,11 @@ "git-hooks-manager": "./index.js", "ghm": "./index.js" }, + "scripts": { + "test": "node --test" + }, "engines": { - "node": ">=18" + "node": ">=20" }, "keywords": [ "developer-tools", diff --git a/test/smoke.test.js b/test/smoke.test.js new file mode 100644 index 0000000..42b1787 --- /dev/null +++ b/test/smoke.test.js @@ -0,0 +1,8 @@ +import { test } from 'node:test' +import { execFileSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' +import { dirname, join } from 'node:path' + +const root = join(dirname(fileURLToPath(import.meta.url)), '..') + +test('entry is valid JavaScript', () => { execFileSync('node', ['--check', join(root, 'index.js')]) })