From 604443051c01b4adfa5f2fee6ae445f5f9c98714 Mon Sep 17 00:00:00 2001 From: Cliffano Subagio Date: Sun, 17 Mar 2024 14:29:50 +1100 Subject: [PATCH] Add javascript test. --- test/javascript/get.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/javascript/get.js diff --git a/test/javascript/get.js b/test/javascript/get.js new file mode 100644 index 0000000..7a3fd8f --- /dev/null +++ b/test/javascript/get.js @@ -0,0 +1,23 @@ +const assert = require('assert'); +const OpenapiIplocation = require('openapi_iplocation'); +const api = new OpenapiIplocation.DefaultApi(); + +describe('iplocation get', function() { + describe('json format', function() { + it('should return a JSON payload', function(done) { + const ip = '8.8.8.8'; + const opts = { + 'format': 'json' + }; + var callback = function(error, data, response) { + if (error) { + console.error(error); + assert.fail(); + } else { + console.log('Data: ' + data); + } + }; + api.rootGet(ip, opts, callback); + }); + }); +}); \ No newline at end of file