Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions config/karma.config.js

This file was deleted.

2 changes: 0 additions & 2 deletions config/karma.webpack.js

This file was deleted.

11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"jsnext:main ": "index.js",
"scripts": {
"lint": "eslint --ext .js,.jsx ./config ./example ./lib ./test",
"test": "karma start ./config/karma.config.js",
"test": "babel-node test/run.js",
"build": "npm run lint && npm run test && webpack --config ./config/build.config.js",
"example": "cd example && node ./sitemap-builder.js",
"documentation": "documentation build ./lib ./lib/routes-parser ./lib/paths-filter ./lib/params-applier ./lib/sitemap-builder -f md > api.md",
Expand All @@ -41,17 +41,10 @@
"documentation": "git://github.com/documentationjs/documentation.git#v4.0.0-beta5",
"eslint": "^2.10.1",
"eslint-plugin-react": "^5.1.1",
"jasmine": "^2.5.3",
"jasmine-collection-matchers": "^0.2.0",
"jasmine-core": "^2.4.1",
"jasmine-expect": "^2.0.2",
"karma": "^0.13.22",
"karma-cli": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-jasmine-matchers": "^2.0.2",
"karma-minimalist-reporter": "^0.2.0",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.7.0",
"phantomjs-prebuilt": "^2.1.7",
"webpack": "^1.13.0",
"webpack-node-externals": "^1.2.0"
Expand Down
5 changes: 5 additions & 0 deletions test/run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Jasmine from 'jasmine';

const jasmine = new Jasmine();
jasmine.loadConfigFile('test/spec/support/jasmine.json');
jasmine.execute();
30 changes: 30 additions & 0 deletions test/spec/sitemap-builder/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'jasmine-collection-matchers';
import buildSitemap from '../../../lib/sitemap-builder';

describe('sitemap builder', () => {

it('should build the sitemap', () => {

const paths = [
'/hello/',
];

const hostname = 'http://localhost';

const etalon = {
limit: 50000,
hostname,
urls: [
{
url: '/hello/',
}
],
cacheResetPeriod: 0,
cache: ''
};

expect(buildSitemap(hostname, paths)).toHaveSameItems(etalon, true);

});

});
11 changes: 11 additions & 0 deletions test/spec/support/jasmine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"spec_dir": "test/spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}