<commit_before>'use strict';

var assert = require('assert');
var sinon = require('sinon');

var Api = require('../../lib/endpoints/api');
var Request = require('../../lib/request');

describe('endpoints/api', function () {
    describe('listFunctions', function () {
        it('should set the request URL', function () {
            var request = new Request();
            var api;
            var stub;

            stub = sinon.stub(request, 'get', function (url) {
                assert.strictEqual(url, '/api/listfunctions');
            });

            api = new Api(request);
            api.listFunctions();

            assert.ok(stub.called);
        });
    });

    describe('maintenance', function () {
        it('should set the request URL', function () {
            var request = new Request();
            var api;
            var stub;

            stub = sinon.stub(request, 'get', function (url) {
                assert.strictEqual(url, '/api/maintenance');
            });

            api = new Api(request);
            api.maintenance();

            assert.ok(stub.called);
        });
    });

    describe('serviceInfo', function () {
        it('should set the request URL', function () {
            var request = new Request();
            var api;
            var stub;

            stub = sinon.stub(request, 'get', function (url) {
                assert.strictEqual(url, '/api/serviceinfo');
            });

            api = new Api(request);
            api.serviceInfo();

            assert.ok(stub.called);
        });
    });
});<commit_msg>Rewrite Api tests to ES2015<commit_after>'use strict';

const assert = require('assert');
const sinon = require('sinon');

const Api = require('../../lib/endpoints/api');
const Request = require('../../lib/request');

describe('endpoints/api', () => {
    describe('listFunctions', () => {
        it('should set the request URL', () => {
            const request = new Request();
            const api = new Api(request);
            const stub = sinon.stub(request, 'get', (url) => {
                assert.strictEqual(url, '/api/listfunctions');
            });

            api.listFunctions();

            assert.ok(stub.called);
        });
    });

    describe('maintenance', () => {
        it('should set the request URL', () => {
            const request = new Request();
            const api = new Api(request);
            const stub = sinon.stub(request, 'get', (url) => {
                assert.strictEqual(url, '/api/maintenance');
            });

            api.maintenance();

            assert.ok(stub.called);
        });
    });

    describe('serviceInfo', () => {
        it('should set the request URL', () => {
            const request = new Request();
            const api = new Api(request);
            const stub = sinon.stub(request, 'get', (url) => {
                assert.strictEqual(url, '/api/serviceinfo');
            });

            api.serviceInfo();

            assert.ok(stub.called);
        });
    });
});
{'fraction_non_alphanumeric': 0.16141732283464566, 'fraction_numerical': 0.0013123359580052493, 'mean_word_length': 1.7223214285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6305890', 'n_tokens_mistral': 814, 'n_tokens_neox': 805, 'n_words': 188}