Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 0a53241

Browse files
committed
refactor: idk lol
1 parent 228b27c commit 0a53241

33 files changed

+143
-307
lines changed

e2e/allHint/index.html

Lines changed: 0 additions & 41 deletions
This file was deleted.

e2e/manualBootstrapAlternative/index.html

Lines changed: 0 additions & 29 deletions
This file was deleted.

e2e/noHint/app-controller.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

e2e/noHint/app.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

e2e/noHint/index.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

e2e/noHint/noHint.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

examples/all-hint.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!doctype html>
2+
<html ng-app='sample' ng-hint>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Angular Hint Example</title>
6+
</head>
7+
<body ng-app='sampleAllHint' ng-controller="Hint">
8+
<div>
9+
This div has a misspelled ng-repeat that ng-hint-directives would hint about.
10+
<ul>
11+
<li ng-repaet="i in [1, 2, 3, 4]">{{i}}</li>
12+
</ul>
13+
</div>
14+
15+
<div id="test">
16+
This is a test div that the controller will attempt to remove. Such manipulation
17+
of the DOM will cause ng-hint-dom to log a message if it is loaded correctly
18+
by the ng-hint tag.
19+
</div>
20+
21+
<div ng-click="increment()">
22+
This div has an ng-click bound to a function that does not exist on the scope. ng-hint-events
23+
should warn about it.
24+
</div>
25+
26+
<a ng-href="{{data.results[0].urls.main_url}}">Link to trigger ng-hint-interpolation.</a>
27+
28+
<div>Module output: </div>
29+
30+
<div id="console"></div>
31+
32+
<script src="../util.js"></script>
33+
<script src="../../bower_components/angular/angular.js"></script>
34+
<script src="../../dist/hint.js"></script>
35+
<script>
36+
angular.module('sample', []);
37+
angular.module('sampleAllHint', []);
38+
angular.module('sampleAllHint').
39+
//A controller should be named ending in 'Controller'. ngHintControllers should warn
40+
//about this best practice
41+
controller('Hint', ['$scope', function($scope) {
42+
var element = document.getElementById('test');
43+
}]);
44+
</script>
45+
</body>
46+
47+
</html>
File renamed without changes.

examples/broken-example/app.css

Lines changed: 0 additions & 47 deletions
This file was deleted.
File renamed without changes.

examples/correct-example/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/correct-example/app.css

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
var consoleText = require('./util.protractor');
4+
5+
describe('angularHint', function() {
6+
it('should warn if ng-hint is called with unknown options', function() {
7+
browser.get('exclude-wrong-module-name/');
8+
expect(consoleText())
9+
.toContain('Angular Hint: General; Warning; Module ngHintExcludeWrongModuleName could not be found;');
10+
});
11+
});
File renamed without changes.

e2e/hint.spec.js renamed to examples/hint.spec.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
'use strict';
22

33
describe('angularHint', function() {
4-
5-
it('should warn if ng-hint is called with unknown options', function() {
6-
browser.get('includeWrongModuleName/');
7-
expect(consoleText())
8-
.toBe('Angular Hint: General; Warning; Module ngHintWrongModuleName could not be found;');
9-
10-
browser.get('excludeWrongModuleName/');
11-
expect(consoleText())
12-
.toContain('Angular Hint: General; Warning; Module ngHintExcludeWrongModuleName could not be found;');
13-
});
14-
15-
164
it('should include all modules by ng-hint default', function() {
175
browser.get('allHint/');
186

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
var consoleText = require('./util.protractor');
4+
5+
describe('angularHint', function() {
6+
it('should warn if ng-hint is called with unknown options', function() {
7+
browser.get('include-wrong-module-name/');
8+
expect(consoleText())
9+
.toBe('Angular Hint: General; Warning; Module ngHintWrongModuleName could not be found;');
10+
});
11+
});
File renamed without changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!doctype html>
2+
<html>
3+
<head ng-hint>
4+
<meta charset="utf-8">
5+
<title>Angular Hint Example</title>
6+
7+
<script src="../../bower_components/angular/angular.js"></script>
8+
<script src="../../bower_components/angular-route/angular-route.js"></script>
9+
<script src="../../dist/hint.js"></script>
10+
<script src="../util.js"></script>
11+
12+
</head>
13+
<body>
14+
<div id="title">Manual Bootstrap Example</div>
15+
<div ng-controller="ManualHintController" id="test">
16+
This is a test div that the controller will attempt to remove. Such manipulation
17+
of the DOM will cause ng-hint-dom to log a message if it is loaded correctly
18+
by the manual bootstrapping.
19+
</div>
20+
</body>
21+
22+
<script>
23+
angular.module('manualBootstrapHintAlternative', [])
24+
.controller('ManualHintController', function() {
25+
var element = document.getElementById('test');
26+
});
27+
angular.bootstrap(document, ['manualBootstrapHintAlternative']);
28+
</script>
29+
</html>
File renamed without changes.

examples/strict-di.html

Whitespace-only changes.

e2e/util.js renamed to examples/util.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@ console.groupEnd = function() {};
2222

2323
console._log = console.log;
2424
console.log = logToElement;
25-
26-
27-
//angular.hint.onMessage = angular.hint.flush;
28-

examples/util.protractor.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function consoleText() {
2+
return element(by.id('console')).getText();
3+
}

hint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require('./src/modules/controllers');
99
// require('./src/modules/dom');
1010
// require('./src/modules/events');
1111
// require('./src/modules/interpolation');
12-
require('./src/modules/modules');
12+
// require('./src/modules/modules');
1313
require('./src/modules/scopes');
1414

1515
// List of all possible modules

karma.conf.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ module.exports = function(config) {
1212
files: [
1313
'node_modules/angular/angular.js',
1414
'node_modules/angular-mocks/angular-mocks.js',
15-
'src/modules/log.js',
16-
'src/modules/*.js'
15+
'hint.js',
16+
{pattern: 'src/**/*.js', included: false, served: false, watched: true},
17+
'test/*.spec.js'
1718
],
1819
preprocessors: {
19-
'lib/modules/controllers.js': ['browserify'],
20-
'lib/modules/events.js': ['browserify'],
21-
'lib/modules/scopes.js': ['browserify']
20+
'hint.js': ['browserify']
2221
},
2322
browsers: ['Chrome'],
2423
browserify: {

0 commit comments

Comments
 (0)