Skip to content

Commit

Permalink
Merge pull request #150 from Cyberbeni/also-format-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberbeni authored Oct 15, 2024
2 parents a638900 + 448d373 commit 3c4618d
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 77 deletions.
9 changes: 0 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,3 @@ test:
once-mac:
brew reinstall npm
brew reinstall yarn

.PHONY: clean
clean:
rm -f tsconfig.tsbuildinfo
rm -rf dist

.PHONY: git-status
git-status:
@[ "$$(git status --porcelain)" = "" ] || ( echo "\033[0;31mError:\033[0m Working directory is dirty."; exit 1 )
6 changes: 3 additions & 3 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SwiftToolInstaller } from '../src/installer'

test('Test Package.resolved v3 parsing', async() => {
const installer = new SwiftToolInstaller("https://github.com/nicklockwood/SwiftFormat", "", "" , "", false)
const version = installer.parsePackageResolved()
expect(version).toBe("ab6844edb79a7b88dc6320e6cee0a0db7674dac3")
const installer = new SwiftToolInstaller('https://github.com/nicklockwood/SwiftFormat', '', '' , '', false)
const version = installer.parsePackageResolved()
expect(version).toBe('ab6844edb79a7b88dc6320e6cee0a0db7674dac3')
})
8 changes: 8 additions & 0 deletions __tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "..",
"noEmit": true
},
"include": ["."]
}
8 changes: 6 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import js from "@eslint/js"
import ts from "typescript-eslint"

export default ts.config({
files: ["src/**/*.ts"],
files: [
"src/**/*.ts",
"__tests__/**/*.ts",
],
ignores: ["src/vendor/**"],
extends: [
js.configs.recommended,
Expand All @@ -13,7 +16,8 @@ export default ts.config({
parser: ts.parser,
parserOptions: {
sourceType: "script",
project: "tsconfig.json"
project: true,
tsconfigRootDir: "."
},
globals: {
...globals.node
Expand Down
20 changes: 10 additions & 10 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
testMatch: ['**/__tests__/*.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest'
},
verbose: true
}
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
testMatch: ['**/__tests__/*.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest'
},
verbose: true
}
76 changes: 38 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
"name": "install-swift-tool",
"description": "Install swift based tools inside a GitHub Action.",
"repository": {
"type": "git",
"url": "github:Cyberbeni/install-swift-tool.git"
},
"scripts": {
"format": "eslint --max-warnings=0 --fix .",
"lint": "eslint .",
"build": "ncc build --minify --out dist src/main.ts",
"test": "jest"
},
"keywords": [],
"author": "Cyberbeni",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.2.4",
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"os": "^0.1.2",
"semver": "^7.6.3",
"uuid": "^10.0.0"
},
"devDependencies": {
"@eslint/js": "^9.11.1",
"@tsconfig/node20": "^20.1.4",
"@types/jest": "^29.5.13",
"@types/node": "^22.7.4",
"@types/semver": "^7.5.8",
"@types/uuid": "^10.0.0",
"@vercel/ncc": "^0.38.2",
"eslint": "^9.11.1",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"ts-jest": "^29.2.5",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.1"
}
"name": "install-swift-tool",
"description": "Install swift based tools inside a GitHub Action.",
"repository": {
"type": "git",
"url": "github:Cyberbeni/install-swift-tool.git"
},
"scripts": {
"format": "eslint --max-warnings=0 --fix .",
"lint": "eslint .",
"build": "ncc build --minify --out dist src/main.ts",
"test": "jest"
},
"keywords": [],
"author": "Cyberbeni",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.2.4",
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"os": "^0.1.2",
"semver": "^7.6.3",
"uuid": "^10.0.0"
},
"devDependencies": {
"@eslint/js": "^9.11.1",
"@tsconfig/node20": "^20.1.4",
"@types/jest": "^29.5.13",
"@types/node": "^22.7.4",
"@types/semver": "^7.5.8",
"@types/uuid": "^10.0.0",
"@vercel/ncc": "^0.38.2",
"eslint": "^9.11.1",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"ts-jest": "^29.2.5",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.1"
}
}
30 changes: 15 additions & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
// Build:
"incremental": false,
"rootDir": "./src",
"declaration": false,
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
// Build:
"incremental": false,
"rootDir": "./src",
"declaration": false,

// Lint:
"strict": true,
"noImplicitAny": false,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"exclude": ["node_modules", "__tests__"]
// Lint:
"strict": true,
"noImplicitAny": false,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src"]
}

0 comments on commit 3c4618d

Please sign in to comment.