Skip to content

Commit

Permalink
Add specs for paths config
Browse files Browse the repository at this point in the history
  • Loading branch information
lifesinger committed Mar 5, 2013
1 parent 2e21cdf commit c1add4c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/specs/config/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ define([
'debug',
'hasOwnProperty',
'map',
'paths',
'preload',
'vars'
])
Expand Down
29 changes: 29 additions & 0 deletions tests/specs/config/paths/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

seajs.config({
alias: {
'b': 'biz/b'
},
paths: {
'biz': './path/to/biz',
'to': './path/to'
}
})


define(function(require) {

var test = require('../../../test')

var a = require('to/a')
var b = require('b')

test.assert(a.name === 'a', a.name)
test.assert(b.name === 'b', b.name)

require.async('to/c', function(c) {
test.assert(c.name === 'c', c.name)
test.next()
})

})

1 change: 1 addition & 0 deletions tests/specs/config/paths/path/to/a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
define({ name: 'a' })
1 change: 1 addition & 0 deletions tests/specs/config/paths/path/to/biz/b.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
define({ name: 'b' })
1 change: 1 addition & 0 deletions tests/specs/config/paths/path/to/c.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
define({ name: 'c' })

0 comments on commit c1add4c

Please sign in to comment.