This TypeScript package provides Wasaby type system for efficient work with types, data structures, collections and types transformation.
All you need is just saby-types package on npm.
-
Create a new npm package in separated folder:
npm init
-
Install typescript and saby-types packages:
npm install typescript npm install git+https://git.sbis.ru/saby/Types.git
-
Create a new hello-world.ts file:
import {entity} from 'saby-types'; const record = new entity.Record({ rawData: {hello: 'Hello world!'} }); console.log(record.get('hello'));
-
Clone the repository in separated folder:
git clone git@git.sbis.ru:saby/Types.git ./
-
Install development dependencies:
npm install
-
Build the project:
npm run build
-
Compile TypeScript:
npm run build:compile
-
Run unit tests in Node.js:
npm test
-
Start local HTTP server and check unit tests in browser:
npm start
-
Run unit tests in Node.js and display coverage report:
npm test:coverage
With checkbox
✓ Inject environment variables to the build process
you can use these environment variables:
test_server_port
- port for local HTTP server (1025
by default);test_url_host
- hostname which HTTP server running on (localhost
by default). You should setup this variable if Selenium grid on another host is used;test_url_port
- the same astest_server_port
;test_report
- XUnit report filename to save report toartifacts/xunit-report.xml
by default).