Skip to content

Commit a273a69

Browse files
committed
Initial commit
0 parents  commit a273a69

29 files changed

+4659
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
app/lib/

.jshintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"strict": "global",
3+
"globals": {
4+
"angular": true
5+
}
6+
}

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
sudo: false
3+
node_js:
4+
- '8'

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
AngularJS 1.x testing with Jasmine
2+
3+
$ git clone [email protected]/ashawley/angularjs-jasmine-karma.git -o upstream
4+
5+
$ npm install
6+
added 469 packages in 20.186s
7+
8+
$ npm install -g karma-cli
9+
/usr/local/bin/karma -> /usr/local/lib/node_modules/karma-cli/bin/karma
10+
11+
added 3 packages in 3.408s
12+
13+
$ npm start
14+
15+
> [email protected] start ./angularjs-jasmine-karma
16+
> http-server -a localhost -p 8080 -c-1 ./app
17+
18+
Starting up http-server, serving ./app
19+
Available on:
20+
http://localhost:8080
21+
Hit CTRL-C to stop the server
22+
23+
$ karma start --single-run
24+
INFO [karma]: Karma v0.13.22 server started at http://localhost:9877/
25+
TOTAL: 18 SUCCESS
26+
27+
$ karma start --browsers Chrome
28+
29+
https://docs.angularjs.org/tutorial
30+
https://docs.angularjs.org/guide
31+
http://bguiz.github.io/js-standards/angularjs/naming/

app/app.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
angular.module('myApp', [
4+
'ngRoute',
5+
'ngSanitize',
6+
'mainModule'
7+
]);

app/appConfig.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
angular.module('myApp')
4+
.config(function (mainProvider) {
5+
mainProvider.setGreeting('HELLO, WORLD!');
6+
}
7+
);

app/index.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!doctype html>
2+
<html lang="en" ng-app="myApp">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<title>Hello, world!</title>
8+
<meta name="description" content="">
9+
<meta name="viewport" content="width=device-width, initial-scale=1">
10+
11+
<link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap.css" />
12+
<!-- <link rel="stylesheet" href="app.css"> -->
13+
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
14+
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
15+
<!--[if lt IE 9]>
16+
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
17+
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
18+
<![endif]-->
19+
</head>
20+
<body class="container" ng-controller="mainController">
21+
<main-directive/>
22+
23+
<script src="lib/jquery/dist/jquery.js"></script>
24+
<script src="lib/angular/angular.js"></script>
25+
<script src="lib/angular-route/angular-route.js"></script>
26+
<script src="lib/angular-sanitize/angular-sanitize.js"></script>
27+
<script src="main/mainModule.js"></script>
28+
<script src="main/mainValue.js"></script>
29+
<script src="main/mainService.js"></script>
30+
<script src="main/mainProvider.js"></script>
31+
<script src="main/mainFilter.js"></script>
32+
<script src="main/mainController.js"></script>
33+
<script src="main/mainDirective.js"></script>
34+
<!-- <script src="main/mainConfig.js"></script> -->
35+
<script src="app.js"></script>
36+
<!-- <script src="appConfig.js"></script> -->
37+
<script src="lib/bootstrap/dist/js/bootstrap.js"></script>
38+
</body>
39+
</html>

app/main/mainConfig.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
angular.module('mainModule')
4+
.config(function (mainProvider) {
5+
mainProvider.setGreeting('Hello, world!');
6+
}
7+
);

app/main/mainController.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
angular.module('mainModule').controller('mainController',
4+
function ($scope, mainProvider) {
5+
$scope.greeting = 'Hello, world!'; // mainProvider.greeting();
6+
}
7+
);

app/main/mainDirective.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
angular.module('mainModule')
4+
.directive('mainDirective', function () {
5+
return {
6+
template: '<h1>{{greeting}}</h1>'
7+
// templateUrl: 'main/mainView.html'
8+
};
9+
}
10+
);

0 commit comments

Comments
 (0)