<commit_before>/*!
 * qwebs
 * Copyright(c) 2016 <NAME>
 * MIT Licensed
 */
"use strict";

const Qwebs = require("../../lib/qwebs");
const http = require("http");
const request = require('request');

describe("post", () => {

    it("create", done => {
        let server = null;
        return Promise.resolve().then(() => {
            let $qwebs = new Qwebs({ dirname: __dirname, config: {}});
            
            $qwebs.inject("$info", "../services/info");
            $qwebs.delete("/save", "$info", "delete");

            return $qwebs.load().then(() => {
                server = http.createServer((request, response) => {
                    return $qwebs.invoke(request, response).then(res => {
                        expect(res.status).toBe("saved");
                    }).catch(error => {
                        expect(error).toBeNull();
                    }).then(() => {
                        done();
                    });
                }).listen(1337);
                
                let $client = $qwebs.resolve("$client");
                $client.delete("http://localhost:1337/delete", { login: "test" });
            });
        }).catch(error => {
            expect(error.message).toBeNull();
        }).then(() => {
            if (server) server.close();
            done();
        });
    });
});
<commit_msg>Update delete.spec.js<commit_after>/*!
 * qwebs
 * Copyright(c) 2016 <NAME>
 * MIT Licensed
 */
"use strict";

const Qwebs = require("../../lib/qwebs");
const http = require("http");
const request = require('request');

describe("post", () => {

    it("create", done => {
        let server = null;
        return Promise.resolve().then(() => {
            let $qwebs = new Qwebs({ dirname: __dirname, config: {}});
            
            $qwebs.inject("$info", "../services/info");
            $qwebs.delete("/save", "$info", "delete");

            return $qwebs.load().then(() => {
                server = http.createServer((request, response) => {
                    return $qwebs.invoke(request, response).then(res => {
                        expect(res.status).toBe("deleted");
                    }).catch(error => {
                        expect(error).toBeNull();
                    }).then(() => {
                        done();
                    });
                }).listen(1337);
                
                let $client = $qwebs.resolve("$client");
                $client.delete("http://localhost:1337/delete", { login: "test" });
            });
        }).catch(error => {
            expect(error.message).toBeNull();
        }).then(() => {
            if (server) server.close();
            done();
        });
    });
});

{'fraction_non_alphanumeric': 0.19114391143911438, 'fraction_numerical': 0.008856088560885609, 'mean_word_length': 1.4917279411764706, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '4502371', 'n_tokens_mistral': 760, 'n_tokens_neox': 696, 'n_words': 131}