I am new to node.js and I am trying to use the GDAX API. I downloaded all of the programs and followed the instructions. I have not edited any of the .js files and I am just trying to run one of the provided test files.
npm outdated
has all dependencies with their Wanted version and npm list
has all dependencies in the green as the tree structure.
I use node public_client.js
to run the test file.
Note all of the code was cloned from a git repository.
Here is an image of the error: ERROR (Not enough history to embed images)
Here is the error in terminal:
Alecs-MacBook-Pro:tests Alec$ node public_client.js
/Users/Alec/Documents/Trading/gdax-node/tests/public_client.js:9
suite('PublicClient');
^
ReferenceError: suite is not defined
at Object.<anonymous> (/Users/Alec/Documents/Trading/gdax-node/tests/public_client.js:9:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
Here are the first nine lines of the file:
var assert = require('assert');
var nock = require('nock');
var Gdax = require('../index.js');
var publicClient = new Gdax.PublicClient();
var EXCHANGE_API_URL = 'https://api.gdax.com';
suite('PublicClient');
Here is the index file:
var PublicClient = require('./lib/clients/public.js');
var WebsocketClient = require('./lib/clients/websocket.js');
var AuthenticatedClient = require('./lib/clients/authenticated.js');
var Orderbook = require('./lib/orderbook.js');
var OrderbookSync = require('./lib/orderbook_sync.js');
module.exports = exports = {
'PublicClient' : PublicClient,
'WebsocketClient' : WebsocketClient,
'AuthenticatedClient': AuthenticatedClient,
'Orderbook' : Orderbook,
'OrderbookSync' : OrderbookSync,
};
That package is using mocha
to run the tests. They have a script
entry ready for that, so just run npm test
and voila.
The command is using is in the package.json:
"scripts": {
"test": "mocha --ui qunit --bail --reporter list tests/*.js"
}