Skip to content

Commit

Permalink
test: script for installing unleash-client-js in other ts packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Feb 4, 2025
1 parent 281d0e3 commit 356a10a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ build/Release
# typescript lives in src, output in lib
lib/
.vscode

# test files
/test-package
15 changes: 15 additions & 0 deletions scripts/test-package/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

TEST_DIR="test-package"

mkdir "$TEST_DIR"
cp scripts/test-package/test-tsconfig.json "$TEST_DIR/tsconfig.json"
cp scripts/test-package/test-package.json "$TEST_DIR/package.json"
cd "$TEST_DIR"
npm install --install-links
mkdir src
echo -e "import { Unleash } from 'unleash-client';\nvoid Unleash;\nconsole.log('Hello world');" > src/index.ts
./node_modules/.bin/tsc -b tsconfig.json
cd ..
rm -rf "$TEST_DIR"
19 changes: 19 additions & 0 deletions scripts/test-package/test-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "test",
"version": "1.0.0",
"main": "lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"typescript": "^5.7.3"
},
"dependencies": {
"unleash-client": "file:.."
}
}
19 changes: 19 additions & 0 deletions scripts/test-package/test-tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"declaration": true,
"inlineSourceMap": true,
"pretty": true,
"noImplicitAny": true,
"allowJs": false,
"resolveJsonModule": true,
"composite": true,
"outDir": "./lib",
"rootDir": "./src"
},
"include": ["src/**/*"]
}

0 comments on commit 356a10a

Please sign in to comment.