Skip to content

Commit

Permalink
mit facts and test
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsan committed Jun 30, 2020
1 parent 9a34aaf commit c95fa12
Show file tree
Hide file tree
Showing 5 changed files with 4,225 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script src="mit.js"></script>

<h1>MIT</h1>

<script>
console.log('city: ' + mit.city);
console.log('colors: ' + mit.colors);
console.log('mascott: ' + mit.mascot);
console.log('founded: ' + mit.founded);
console.log('motto: ' + mit.motto);
</script>
7 changes: 7 additions & 0 deletions mit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var mit = {
city: 'Cambridge',
colors: ['pink', 'red'],
mascot: "robot",
founded: 1900,
motto: 'Carpe diem',
};
28 changes: 28 additions & 0 deletions mit.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var utils = require('course-utilities');
var mit = utils.load('./mit.js', 'mit');

describe('MIT', () => {

test('Object properties present', () => {
expect(mit).toHaveProperty('city');
expect(mit).toHaveProperty('colors');
expect(mit).toHaveProperty('mascot');
});

test('City match', () => {
expect(mit.city).toBe('Cambridge');
});

test('Colors match', () => {
expect(mit.colors).toContain('Silver Gray');
});

test('Founded range', () => {
expect(mit.founded).toBeLessThanOrEqual(1875);
expect(mit.founded).toBeGreaterThanOrEqual(1850);
});

test('Motto', () => {
expect(mit.motto).toMatch('Mens');
});
});
Loading

0 comments on commit c95fa12

Please sign in to comment.