<commit_before>// tslint:disable-next-line: no-reference
import * as https from "https";
import * as qmFileSystem from "../src/helpers/qm.file-system";
const isWin = process.platform === "win32";
jest.setTimeout(10000);
describe("s3 uploader", () => {
  test("uploads a file", () => {
    qmFileSystem.uploadToS3("ionIcons.js", "tests", function(uploadResponse) {
      const url = require("url");
      const myURL = url.parse(uploadResponse.Location);
      const options = {
        hostname: myURL.hostname,
        port: 443,
        path: myURL.path,
        method: "GET"
      };
      const req = https.request(options, res => {
        console.log(`statusCode: ${res.statusCode}`);
        expect(res.statusCode).toEqual(200);
        res.on("data", d => {
          expect(d).toContain("iosArrowUp");
        });
      });
      req.on("error", error => {
        console.error(error);
      });
      req.end();
    });
  });
});<commit_msg>d = buffer.toString('base64');<commit_after>import { expect } from 'chai';
import * as https from "https";
import * as qmFileSystem from "../src/helpers/qm.file-system";
import * as url from "url";
const isWin = process.platform === "win32";
describe("s3 uploader", () => {
  it("uploads a file", () => {
    qmFileSystem.uploadToS3("ionIcons.js", "tests", function(uploadResponse) {
      const myURL = url.parse(uploadResponse.Location);
      const options = {
        hostname: myURL.hostname,
        port: 443,
        path: myURL.path,
        method: "GET"
      };
      const req = https.request(options, res => {
        console.log(`statusCode: ${res.statusCode}`);
        expect(res.statusCode).to.eq(200);
        res.on("data", d => {
          var buffer = Buffer.concat(d);
          d = buffer.toString('base64');
          expect(d).to.contain("iosArrowUp");
        });
      });
      req.on("error", error => {
        console.error(error);
      });
      req.end();
    });
  });
});
{'fraction_non_alphanumeric': 0.17899031106578275, 'fraction_numerical': 0.014788373278939317, 'mean_word_length': 2.560798548094374, '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': '5602724', 'n_tokens_mistral': 638, 'n_tokens_neox': 623, 'n_words': 120}