forked from js-kyle/connect-assets
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allowing options.src to be an absolute path
- Loading branch information
1 parent
cde838d
commit 412cddd
Showing
6 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
process.env.NODE_ENV = 'development' | ||
path = require 'path' | ||
request = require 'request' | ||
|
||
app = require('connect').createServer() | ||
assets = require('../lib/assets.js') | ||
app.use assets src: path.join(__dirname, 'assets') | ||
app.listen 3590 | ||
|
||
# exports['Compiled stylesheets work from absolute options.src'] = (test) -> | ||
# cssTag = "<link rel='stylesheet' href='/css/button.css'>" | ||
# test.equals css('button'), cssTag | ||
# test.done() | ||
|
||
# request 'http://localhost:3588/css/button.css', (err, res, body) -> | ||
# throw err if err | ||
# expectedBody = ''' | ||
# .button { | ||
# -webkit-border-radius: 5px; | ||
# -moz-border-radius: 5px; | ||
# border-radius: 5px; | ||
# }\n | ||
# ''' | ||
# test.equals body, expectedBody | ||
# test.done() | ||
|
||
exports['JS dependencies work from absolute options.src'] = (test) -> | ||
jsTags = """<script src='/js/subdir/nested/hobbits.js'></script> | ||
<script src='/js/tree-dependent.js'></script> | ||
""" | ||
test.equals js('tree-dependent'), jsTags | ||
test.done() | ||
app.close() |