Browse Source

add tests

Benoît Hubert 8 years ago
parent
commit
287f18c08c

+ 14 - 0
test/integration/render-index.test.js

@@ -0,0 +1,14 @@
+const chai          = require('chai');
+const should        = chai.should();
+const ExampleStore  = require('../../lib/ExampleStore');
+const exStore       = new ExampleStore(__dirname + '/test-examples');
+
+describe('render index', () => {
+
+  before(() => exStore.init());
+
+  it('without selected repo or example', () => {
+
+  });
+
+});

+ 9 - 0
test/integration/test-examples/example-repo1/repo-config.json

@@ -0,0 +1,9 @@
+{
+  "title": "Example Repo 1",
+  "categories": [
+    {
+      "slug": "test-stuff",
+      "title": "Test Stuff"
+    }
+  ]
+}

+ 9 - 0
test/integration/test-examples/example-repo1/repo1-example1/config.json

@@ -0,0 +1,9 @@
+{
+  "title": "Test Example",
+  "category": "test-example",
+  "html": [ "example.html" ],
+  "js": [ "script.js" ],
+  "css": [],
+  "libsJs": [],
+  "libsCss": [ "styles.css" ]
+}

+ 1 - 0
test/integration/test-examples/example-repo1/repo1-example1/example.html

@@ -0,0 +1 @@
+<h1>Hi</h1>

+ 1 - 0
test/integration/test-examples/example-repo1/repo1-example1/script.js

@@ -0,0 +1 @@
+console.log('Hi');

+ 9 - 0
test/integration/test-examples/example-repo2/repo-config.json

@@ -0,0 +1,9 @@
+{
+  "title": "Example Repo 2",
+  "categories": [
+    {
+      "slug": "random-stuff",
+      "title": "Random Stuff"
+    }
+  ]
+}

+ 9 - 0
test/integration/test-examples/example-repo2/repo2-example1/config.json

@@ -0,0 +1,9 @@
+{
+  "title": "Random Example",
+  "category": "random-example",
+  "html": [ "example.html" ],
+  "js": [ "script.js" ],
+  "css": [],
+  "libsJs": [],
+  "libsCss": [ "styles.css" ]
+}

+ 1 - 0
test/integration/test-examples/example-repo2/repo2-example1/example.html

@@ -0,0 +1 @@
+<h1>Yo</h1>

+ 1 - 0
test/integration/test-examples/example-repo2/repo2-example1/script.js

@@ -0,0 +1 @@
+console.log('Yo');