blob: 183dce465fcd518765b9164e7b8cba728e8b069d (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 | 'use strict';
/**
 * Matchers for implementing specs. Follows the Jasmine spec conventions.
 */
angular.scenario.matcher('toEqual', function(expected) {
  return angular.equals(this.actual, expected);
});
angular.scenario.matcher('toBe', function(expected) {
  return this.actual === expected;
});
angular.scenario.matcher('toBeDefined', function() {
  return angular.isDefined(this.actual);
});
angular.scenario.matcher('toBeTruthy', function() {
  return this.actual;
});
angular.scenario.matcher('toBeFalsy', function() {
  return !this.actual;
});
angular.scenario.matcher('toMatch', function(expected) {
  return new RegExp(expected).test(this.actual);
});
angular.scenario.matcher('toBeNull', function() {
  return this.actual === null;
});
angular.scenario.matcher('toContain', function(expected) {
  return includes(this.actual, expected);
});
angular.scenario.matcher('toBeLessThan', function(expected) {
  return this.actual < expected;
});
angular.scenario.matcher('toBeGreaterThan', function(expected) {
  return this.actual > expected;
});
 |