Skip to content

Commit

Permalink
Добавлена вторая демонстрационная задача
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Gogolev committed Oct 4, 2016
1 parent 4a0aed0 commit 1d86d93
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 4
indent_style = space
trim_trailing_whitespace = true

[*.json]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
.git
.idea

*.log
*.swp

node_modules
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
save=true
save-exact=true
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-hrundel"
}
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- "6"
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
# demo-task-2
# Демонтстрационная задача «Пятый элемент»

Перед выполнением задания внимательно прочитайте:

- [О всех этапах проверки задания](https://github.com/urfu-2016/guides/blob/master/workflow/extra.md)
- [Как отправить пулл](https://github.com/urfu-2016/guides/blob/master/workflow/pull.md)
- [Как пройти тесты](https://github.com/urfu-2016/guides/blob/master/workflow/test.md)
- Правила оформления [javascript](https://github.com/urfu-2016/guides/blob/master/codestyle/js.md), [HTML](https://github.com/urfu-2016/guides/blob/master/codestyle/html.md) и [CSS](https://github.com/urfu-2016/guides/blob/master/codestyle/css.md) кода

## Основное задание

Добавьте в HTML документ index.html __пять__ разных HTML элементов.

<img width="590" alt="enot" src="https://cloud.githubusercontent.com/assets/4534405/19076552/b1b657ca-8a62-11e6-90c6-c84f12282f32.png">
Empty file added index.css
Empty file.
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Пятый элемент</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<!-- Здесь прикладывать основное усилие -->
</body>
</html>
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"private": true,
"scripts": {
"test": "npm run lint && mocha ./node_modules/html-tests/task-stub/test",
"lint": "stylelint *.css **/*.css"
},
"dependencies": {
"html-tests": "^1.0.0",
"mocha": "3.0.2",
"should": "11.1.0",
"stylelint": "7.3.1",
"stylelint-config-hrundel": "1.0.1"
}
}
19 changes: 19 additions & 0 deletions test/getHtml.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* global describe, it, global */

'use strict';

require('should');
var fs = require('fs');
var files = fs.readdirSync('.');

files = files.filter(file => {
return fs.statSync(file).isFile() && /\.html$/.test(file);
});

describe('Кол-во html файлов', function(){
it('Должен быть один html-файл в проекте', function () {
files.length.should.be.eql(1);
});
});

module.exports = fs.readFileSync(files[0], 'utf-8');
14 changes: 14 additions & 0 deletions test/getUniqTags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';
var html = require('./getHtml');

var tags = [];

html.match(/\<\s*[a-z]+/ig).forEach(function(tag){
tag = tag.replace('<', '');

if (tags.indexOf(tag) === -1) {
tags.push(tag);
}
});

module.exports = tags;
16 changes: 16 additions & 0 deletions test/verstka-task-1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* global describe, it, global */

'use strict';

require('should');

var tags = require('./getUniqTags');

describe('Кол-во тегов.', function(){
it('Должно быть не менее уникальных 5 тегов.', function () {

console.log(' Кол-во уникальных тегов: ' + tags.length);

(tags.length >= 5).should.be.eql(true);
});
});

0 comments on commit 1d86d93

Please sign in to comment.