Skip to content

Commit

Permalink
trying to fix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tcurdt committed Mar 12, 2016
1 parent 62b9ab7 commit 7463a41
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .xstaticignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
plugins
core
10 changes: 7 additions & 3 deletions core/lib/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ function Collection(name, inputs, defaults) {

const filePath = options.path(new FilePath(file.path)).toString()
const fileLmod = self.maxLmod(dependencies)
const fileMeta = file.meta || {}

const fileNew = _.merge(file, {
const fileNew = {
lmod: fileLmod,
path: filePath,
meta: fileMeta,
load: new LazyPromise(function(resolve, reject) {
file.load.then(function(doc) {
const d = _.merge(doc, {
const d = _.merge({
meta: fileMeta,
}, doc, {
lmod: fileLmod,
path: filePath,
})
Expand All @@ -58,7 +62,7 @@ function Collection(name, inputs, defaults) {
reject(err)
})
})
})
}

files.push(fileNew)
return fileNew
Expand Down
4 changes: 2 additions & 2 deletions core/tests/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Test('should replace collection with array', function(t) {
}, function(v) {
return v
}).then(function(context) {
t.deepEqual({ files: [ { body: 'a', path: 'page.txt', lmod: 1 } ] }, context)
t.deepEqual(context, { files: [ { body: 'a', path: 'page.txt', lmod: 1, meta: {}} ] })
})

})
Expand All @@ -58,7 +58,7 @@ Test('should replace glob with array', function(t) {
}, function(v) {
return v
}).then(function(context) {
t.deepEqual({ files: [ { body: 'a' } ] }, context)
t.deepEqual(context, { files: [ { body: 'a' } ] })
})

})
Expand Down
68 changes: 68 additions & 0 deletions deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/sh

# cd core && npm link && cd ..

# PLUGINS=`ls plugins`

# for PLUGIN in $PLUGINS; do
# echo "[$PLUGIN]"

# cd plugins/$PLUGIN
# rm -rf node_modules
# # npm link xstatic-core
# # npm i
# # ls -la node_modules
# # npm test
# cd ../..
# done

# cd plugins/atom && npm link && cd -
# cd plugins/babel && npm link && cd -
# cd plugins/css && npm link && cd -
# cd plugins/epub && npm link && cd -
# cd plugins/filter && npm link && cd -
# cd plugins/frontmatter && npm link && cd -
# cd plugins/handlebars && npm link && cd -
# cd plugins/json && npm link && cd -
# cd plugins/less && npm link && cd -
# cd plugins/markdown && npm link && cd -
# cd plugins/merge && npm link && cd -
# cd plugins/nunjucks && npm link && cd -
# cd plugins/sass && npm link && cd -
# cd plugins/sitemap && npm link && cd -
# cd plugins/sort && npm link && cd -

# npm link xstatic-core
# npm link xstatic-atom
# npm link xstatic-babel
# npm link xstatic-css
# npm link xstatic-epub
# npm link xstatic-filter
# npm link xstatic-frontmatter
# npm link xstatic-handlebars
# npm link xstatic-json
# npm link xstatic-less
# npm link xstatic-markdown
# npm link xstatic-merge
# npm link xstatic-nunjucks
# npm link xstatic-sass
# npm link xstatic-sitemap
# npm link xstatic-sort

npm i \
@tcurdt/tinyutils \
babel-core \
babel-plugin-transform-react-jsx \
blue-tape \
front-matter \
handlebars \
highlight.js \
less \
libxmljs \
marked \
minimatch \
moment \
node-sass \
nunjucks \
tape \
xmlbuilder \

0 comments on commit 7463a41

Please sign in to comment.