Skip to content

Commit ab1f82a

Browse files
committed
Initial commit
0 parents  commit ab1f82a

File tree

6 files changed

+163
-0
lines changed

6 files changed

+163
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.travis.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: node_js
2+
node_js:
3+
- '6.2.1'
4+
notifications:
5+
email: false
6+
cache:
7+
directories:
8+
- node_modules

README.md

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Hello Code School
2+
3+
This is a sample project to test out how projects work at Code School. For this project, you'll be creating a basic website using HTML. If you want to deploy it to a real website, we'll even walkthrough how to do that!
4+
5+
# Getting Started
6+
7+
To get started with this project, head over to the [Hello Code School](https://www.codeschool.com/projects/hello-codeschool) project on Code School, and begin! It'll walk you through all of the steps below. They're included here in the readme in case you work better locally, or want to try working on this project offline.
8+
9+
# Prerequisites
10+
11+
In order to complete this project, you'll need to know the basics of HTML! Aside from that, you'll need a local computer where you can install git, and edit some files. We'll walk you through that part, so if you haven't used Git before -- don't worry. We recommend that you should have already completed Code Schools [Front-End Foundations](https://www.codeschool.com/courses/front-end-foundations) course, or have basic familiarity with HTML. When we say basic familiarity here's what we mean:
12+
13+
* Know what an HTML tag looks like
14+
* Know some of the most common tags -- `title`, `h1`, `ul`, `li`.
15+
16+
If you know these, you should be all set to jump in and give this project a shot!
17+
18+
# Setup
19+
20+
In order to get this working, you'll need to have [Git](https://git-scm.com/) installed, and have a GitHub account. If this is your first time setting up Git, I'd recommend checking out Code School's video on [How to Setup Git for Code School Projects in 5 Minutes](#) to learn what you need to know.
21+
22+
To get started, fork this repository to your account and clone it down locally. If you want, you can also try doing this completely from GitHub!
23+
24+
# Build
25+
26+
Once you've forked this repository, go ahead and make the following changes to the `index.html` file.
27+
28+
## Add a Page Title
29+
30+
Change the `title` to your Code School account name.
31+
32+
## Add a Header Element
33+
34+
Add an `h1` saying "Hello, Code School!".
35+
36+
## Create an Unordered List
37+
38+
Create a `ul` element with at least 2 `li` elements.
39+
40+
## What Do You Want to Learn?
41+
42+
In these `li` elements, list out what you want to learn.
43+
44+
# Checking Your Work
45+
46+
Once you've completed all of the tasks, go ahead and commit those to your fork of this repository and push it up to GitHub. Follow the directions on [Hello Code School](https://www.codeschool.com/projects/hello-codeschool) to submit your project and get feedback from Code School.
47+
48+
## Running Tests Locally
49+
50+
You don't need to run and of the tests locally -- they'll all run when you submit your project. If you're an overachiever and want to try running the tests locally, here's what you'll need to do.
51+
52+
First off, install [node.js](https://nodejs.org/en/) locally. Next you'll need to run a few commands from this folder.
53+
54+
```
55+
$ npm install
56+
$ npm test
57+
```
58+
59+
If everything is working, you should see something like this:
60+
61+
```
62+
HelloCodeSchoolProject (answer) $ npm test
63+
64+
> [email protected] test /Users/adam/code/projects/HelloCodeSchoolProject
65+
> mocha test/
66+
67+
68+
69+
Your HTML Page
70+
✓ should have a different title
71+
✓ should have a different h1
72+
✓ should have a ul
73+
✓ should have at least 2 li elements
74+
75+
76+
4 passing (306ms)
77+
```
78+
79+
# Making it Public
80+
81+
Once all tests are passing, try pushing your master branch up to the `gh-pages` branch -- this will make your webpage available on the web! Here's a command to do that:
82+
83+
```
84+
$ git push origin master:gh-pages
85+
```
86+
87+
This will make your `index.html` file available at the URL:
88+
89+
`http://<username>.github.io/HelloCodeSchoolProject/`
90+
91+
For instance, our `answer` branch is available at the url [http://codeschool.github.io/HelloCodeSchoolProject/](http://codeschool.github.io/HelloCodeSchoolProject/).

index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang='en'>
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 Code School</title>
8+
</head>
9+
<body>
10+
11+
</body>
12+
</html>

package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "hello-codeschool-project",
3+
"version": "1.0.0",
4+
"description": "Sample Code School Project",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "./node_modules/.bin/mocha test/"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"devDependencies": {
12+
"chai": "^3.5.0",
13+
"jsdom": "^9.2.1",
14+
"mocha": "^2.5.3"
15+
}
16+
}

test/index_test.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
var jsdom = require('jsdom'),
2+
fs = require('fs'),
3+
assert = require('chai').assert,
4+
file = fs.readFileSync('index.html').toString();
5+
6+
describe('Your HTML Page', function() {
7+
var window;
8+
before(function(next) {
9+
jsdom.env(
10+
file,
11+
["http://code.jquery.com/jquery.js"],
12+
function (err, w) {
13+
if(err) { next(err); }
14+
window = w;
15+
next();
16+
}
17+
);
18+
});
19+
20+
it('should have a different title', function() {
21+
assert.notEqual(window.$('title').text(), 'Hello Code School');
22+
});
23+
24+
it('should have a different h1', function() {
25+
assert.notEqual(window.$('h1').length, 0);
26+
});
27+
28+
it('should have a ul', function() {
29+
assert.notEqual(window.$('ul').length, 0);
30+
});
31+
32+
it('should have at least 2 li elements', function() {
33+
assert.isAtLeast(window.$('li').length, 2);
34+
});
35+
});

0 commit comments

Comments
 (0)