<commit_before>(function () {
  angular
    .module('directivas')
    .directive('ejercicioTest', function (){
      function Controller(){
        this.contador = 0;
        this.aumenta = () => {
          this.contador += 1;
          this.onAumenta({$valor: this.contador});
        }
      }
      const ddo = {
        template: `
          <p><a ng-click="vm.aumenta()">Click</a></p>
        `,
        scope: {
          onAumenta: '&'
        },
        controllerAs:'vm',
        bindToController: true,
        controller: Controller
      };
      return ddo;
    })
    .factory('testDirectiva', function ($compile, $rootScope, $timeout, $q){
      return () => {
        let scope =  $rootScope.$new();
        scope.contador = null;
        var element = $compile('<ejercicio-test on-aumenta="contador=$valor"></ejercicio-test>')(scope);
        let a = element.find('a')[0];
        $timeout(() => {
          a.click();
          a.click();
        }, 0, false);

        return $q((resolve, reject) => {
          $timeout(()=>{
            scope.contador === 2 ? resolve(): reject();
          },100)
        });
      }
    });
}());<commit_msg>Iimpieza del ejercicio de test<commit_after>(function () {
  angular
    .module('directivas')
    .directive('ejercicioTest', function (){
      function Controller(){
        this.contador = 0;
        this.aumenta = () => {
          this.contador += 1;
          this.onAumenta({$valor: this.contador});
        }
      }
      const ddo = {
        template: `
          <p><a ng-click="vm.aumenta()">Click</a></p>
        `,
        scope: {
          onAumenta: '&'
        },
        controllerAs:'vm',
        bindToController: true,
        controller: Controller
      };
      return ddo;
    })
    .factory('testDirectiva', function ($compile, $rootScope, $timeout, $q){
      return () => {
        $timeout(() => {

        }, 0, false);

        return $q((resolve, reject) => {
          $timeout(()=>{

          },100)
        });
      }
    });
}());
{'fraction_non_alphanumeric': 0.1796759941089838, 'fraction_numerical': 0.006872852233676976, 'mean_word_length': 1.7101063829787233, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, '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': '6594787', 'n_tokens_mistral': 644, 'n_tokens_neox': 623, 'n_words': 108}