This repository contains the libraries developped by Generative Objects for GO generated apps.
No installation / compilation needed, all code is written using ES6 so it needs to be imported accordingly in your project.
It can be referenced in your package.json
file for installation and then imported in your project (that is the default in GO generated applications).
You can directly reference this repository using the following package.json
entry:
dependencies: {
...
"go-front-libs": "git+ssh://git@git.generativeobjects.com:go-core/go-front-libs.git"
...
}
then running npm install
from a command line console where your SSH Agent is logged in. This means the machine where you run that should already have a SSH Key generated and added to your Gitlab account.
In order to be logged in in the console, if you SSH Key has a passphrase, you'll need to run the following:
eval `ssh-agent -s`
ssh-add
To use any methods exported from one of the libraries in ./libs/
, you'll need to add an import
statement at the beggining of the corresponding file, a bit like this:
import { GOUuuid } from 'go-front-libs';
and then use any of the methods exposed by the corresponding module with GOUuuid.newGuid()
A set of unit test is provided. Everything is configured so that you can add tests easily.
-
Run
npm install
in the folder to install all needednode_modules
-
There are 3 test scripts available in the
package.json
file:a.
npm test
will run the tests once, using mochab.
npm run "test-watch"
will start a temporay local web server watching for changes, and running the above command everytime one file is changed (useful for interactive testing)c.
npm run cover
will run the first command and generate a coverage report. A summary is visilble in the console and a full coverage report is available under thetest/coverage/lcov-report/
folder, just open theindex.html
file and browse the report to see which lines of codes (or branches) are not covered.