<commit_before>import { Meteor } from 'meteor/meteor';
import { expect } from 'meteor/practicalmeteor:chai';
import fetch from 'isomorphic-unfetch';

// In theory this test could actually be run on the server as well. Regrettably
// the test runner starts the server tests before the database is fully
// populated. As a result those tests will very likely time out.
if (Meteor.isClient) {
	describe('GroupApi', function () {
		it('should return JSON response', async function () {
			const groups = Meteor.absoluteUrl('/api/0/json/groups');
			const result = await fetch(groups);

			expect(result.status).to.equal(200);
			expect(result.headers.get('Content-Type')).to.equal('application/json; charset=utf-8');
		});
	});
}<commit_msg>deasyncify API test<commit_after>import { Meteor } from 'meteor/meteor';
import { expect } from 'meteor/practicalmeteor:chai';
import fetch from 'isomorphic-unfetch';

// In theory this test could actually be run on the server as well. Regrettably
// the test runner starts the server tests before the database is fully
// populated. As a result those tests will very likely time out.
if (Meteor.isClient) {
	describe('GroupApi', function () {
		it('should return JSON response', function (done) {
			const groups = Meteor.absoluteUrl('/api/0/json/groups');
			fetch(groups).then((result) => {
				expect(result.status).to.equal(200);
				expect(result.headers.get('Content-Type')).to.equal('application/json; charset=utf-8');
				done();
			});
		});
	});
}
{'fraction_non_alphanumeric': 0.13712374581939799, 'fraction_numerical': 0.006688963210702341, 'mean_word_length': 4.40072202166065, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2229760', 'n_tokens_mistral': 491, 'n_tokens_neox': 437, 'n_words': 138}