<commit_before>library jamine;

import 'package:unittest/unittest.dart';
import 'package:js/js.dart' as js;

it(name, fn) {
  if (currentDescribe.exclusive) {
    solo_test(name, fn);
  } else {
    test(name, fn);
  }
}
iit(name, fn) => solo_test(name, fn);
xit(name, fn) {}
xdescribe(name, fn) {}
ddescribe(name, fn) => describe(name, fn, true);


class Describe {
  Describe parent;
  String name;
  bool exclusive;
  List<Function> beforeEachFns = [];
  List<Function> afterEachFns = [];

  Describe(this.name, this.parent, [bool this.exclusive=false]);

  setUp() {
    if (parent != null) {
      parent.setUp();
    }
    beforeEachFns.forEach((fn) => fn());
  }

  tearDown() {
    afterEachFns.reverse.forEach((fn) => fn());
    if (parent != null) {
      parent.tearDown();
    }
  }
}

Describe currentDescribe = new Describe('', null);

describe(name, fn, [bool exclusive=false]) {<commit_msg>feat(jasmine) support describe()in ddescribe()<commit_after>library jamine;

import 'package:unittest/unittest.dart';
import 'package:js/js.dart' as js;

it(name, fn) {
  if (currentDescribe.exclusive) {
    solo_test(name, fn);
  } else {
    test(name, fn);
  }
}
iit(name, fn) => solo_test(name, fn);
xit(name, fn) {}
xdescribe(name, fn) {}
ddescribe(name, fn) => describe(name, fn, true);


class Describe {
  Describe parent;
  String name;
  bool exclusive;
  List<Function> beforeEachFns = [];
  List<Function> afterEachFns = [];

  Describe(this.name, this.parent, [bool this.exclusive=false]) {
    if (parent != null && parent.exclusive) {
      exclusive = true;
    }
  }

  setUp() {
    if (parent != null) {
      parent.setUp();
    }
    beforeEachFns.forEach((fn) => fn());
  }

  tearDown() {
    afterEachFns.reverse.forEach((fn) => fn());
    if (parent != null) {
      parent.tearDown();
    }
  }
}

Describe currentDescribe = new Describe('', null);

describe(name, fn, [bool exclusive=false]) {
{'fraction_non_alphanumeric': 0.17237798546209762, 'fraction_numerical': 0.0, 'mean_word_length': 3.654589371980676, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '5076555', 'n_tokens_mistral': 699, 'n_tokens_neox': 701, 'n_words': 147}