@@ -29,8 +29,8 @@ describe('bit import', function () {
2929 // export a new simple component
3030 helper . createFile ( 'global' , 'simple.js' ) ;
3131 helper . addComponent ( path . normalize ( 'global/simple.js' ) ) ;
32- helper . commitComponent ( 'simple' ) ;
33- helper . exportComponent ( 'simple' ) ;
32+ helper . commitComponent ( 'global/ simple' ) ;
33+ helper . exportComponent ( 'global/ simple' ) ;
3434
3535 helper . reInitLocalScope ( ) ;
3636 helper . addRemoteScope ( ) ;
@@ -272,7 +272,7 @@ describe('bit import', function () {
272272 let output ;
273273 before ( ( ) => {
274274 helper . reInitLocalScope ( ) ;
275- helper . setComponentsDirInBitJson ( '{scope}/{namespace} -{name}' ) ;
275+ helper . setComponentsDirInBitJson ( '{scope}/-{name}- ' ) ;
276276 helper . addRemoteScope ( ) ;
277277 helper . importComponent ( 'global/simple' ) ;
278278 output = helper . importComponent ( 'global/simple' ) ;
@@ -281,15 +281,15 @@ describe('bit import', function () {
281281 expect ( output ) . to . have . string ( 'successfully imported one component' ) ;
282282 } ) ;
283283 it ( 'should import the component into new dir structure according to dsl' , ( ) => {
284- expect ( path . join ( helper . localScopePath , helper . remoteScope , 'global- simple' ) ) . to . be . a . directory (
284+ expect ( path . join ( helper . localScopePath , helper . remoteScope , '-global/ simple- ' ) ) . to . be . a . directory (
285285 'should not be empty'
286286 ) . and . not . empty ;
287287 } ) ;
288288 it ( 'bitmap should contain component with correct rootDir according to dsl' , ( ) => {
289289 const bitMap = helper . readBitMap ( ) ;
290290 const cmponentId = `${ helper . remoteScope } /global/[email protected] ` ; 291291 expect ( bitMap ) . to . have . property ( cmponentId ) ;
292- expect ( bitMap [ cmponentId ] . rootDir ) . to . equal ( `${ helper . remoteScope } /global- simple` ) ;
292+ expect ( bitMap [ cmponentId ] . rootDir ) . to . equal ( `${ helper . remoteScope } /-global/ simple- ` ) ;
293293 } ) ;
294294 } ) ;
295295 } ) ;
@@ -676,8 +676,8 @@ describe('bit import', function () {
676676 const simpleFixture = 'import a from "lodash.isboolean"; ' ;
677677 helper . createFile ( 'global' , 'simple.js' , simpleFixture ) ;
678678 helper . addComponentWithOptions ( 'global/simple.js' , { i : 'global/simple' } ) ;
679- helper . commitComponent ( 'simple' ) ;
680- helper . exportComponent ( 'simple' ) ;
679+ helper . commitComponent ( 'global/ simple' ) ;
680+ helper . exportComponent ( 'global/ simple' ) ;
681681
682682 helper . addNpmPackage ( 'lodash.isstring' , '4.0.0' ) ;
683683 const withDepsFixture = 'import a from "./global/simple.js"; import c from "lodash.isstring"' ;
@@ -2109,8 +2109,8 @@ console.log(barFoo.default());`;
21092109 const simpleFixture = 'import a from "lodash.isboolean"; ' ;
21102110 helper . createFile ( 'global' , 'simple.js' , simpleFixture ) ;
21112111 helper . addComponentWithOptions ( 'global/simple.js' , { i : 'global/simple' } ) ;
2112- helper . commitComponent ( 'simple' ) ;
2113- helper . exportComponent ( 'simple' ) ;
2112+ helper . commitComponent ( 'global/ simple' ) ;
2113+ helper . exportComponent ( 'global/ simple' ) ;
21142114 helper . addNpmPackage ( 'lodash.isstring' , '4.0.0' ) ;
21152115 const withDepsFixture = 'import a from "./global/simple.js"; import c from "lodash.isstring"' ;
21162116 helper . createFile ( '' , 'with-deps.js' , withDepsFixture ) ;
@@ -2137,7 +2137,7 @@ console.log(barFoo.default());`;
21372137 } ) ;
21382138 it ( 'should contain workspaces array in package.json and private true' , ( ) => {
21392139 const pkgJson = helper . readPackageJson ( helper . localScopePath ) ;
2140- expect ( pkgJson . workspaces ) . to . include ( 'components/.dependencies/*/ */*/* ' , 'components/*/*' ) ;
2140+ expect ( pkgJson . workspaces ) . to . include ( 'components/.dependencies/**/*' , 'components/* */*' ) ;
21412141 expect ( pkgJson . private ) . to . be . true ;
21422142 } ) ;
21432143 it ( 'component dep should be install as npm package' , ( ) => {
@@ -2152,7 +2152,7 @@ console.log(barFoo.default());`;
21522152 it ( 'Should not contain duplicate regex in workspaces dir if we run import again ' , ( ) => {
21532153 helper . importComponent ( 'comp/with-deps --override' ) ;
21542154 const pkgJson = helper . readPackageJson ( helper . localScopePath ) ;
2155- expect ( pkgJson . workspaces ) . to . include ( 'components/.dependencies/*/ */*/* ' , 'components/*/*' ) ;
2155+ expect ( pkgJson . workspaces ) . to . include ( 'components/.dependencies/**/*' , 'components/* */*' ) ;
21562156 expect ( pkgJson . workspaces ) . to . be . ofSize ( 2 ) ;
21572157 expect ( path . join ( helper . localScopePath , 'yarn.lock' ) ) . to . be . a . file ( 'no yarn lock file' ) ;
21582158 } ) ;
@@ -2166,19 +2166,15 @@ console.log(barFoo.default());`;
21662166 helper . addKeyValueToPackageJson ( { workspaces : [ 'comp' ] } ) ;
21672167 helper . importComponent ( 'comp/with-deps --override' ) ;
21682168 const pkgJson = helper . readPackageJson ( ) ;
2169- expect ( pkgJson . workspaces ) . to . include (
2170- 'components/.dependencies/*/*/*/*' ,
2171- 'components/*/*' ,
2172- 'test/comp/with-deps'
2173- ) ;
2169+ expect ( pkgJson . workspaces ) . to . include ( 'components/.dependencies/**/*' , 'components/**/*' , 'test/comp/with-deps' ) ;
21742170 } ) ;
21752171 it ( 'Should save workspaces with custom import path ' , ( ) => {
21762172 helper . reInitLocalScope ( ) ;
21772173 helper . addRemoteScope ( helper . remoteScopePath ) ;
21782174 helper . manageWorkspaces ( ) ;
21792175 helper . importComponent ( 'comp/with-deps -p test' ) ;
21802176 const pkgJson = helper . readPackageJson ( ) ;
2181- expect ( pkgJson . workspaces ) . to . include ( 'components/.dependencies/*/ */*/* ' , 'components/*/*' , 'test' ) ;
2177+ expect ( pkgJson . workspaces ) . to . include ( 'components/.dependencies/**/*' , 'components/* */*' , 'test' ) ;
21822178 } ) ;
21832179 } ) ;
21842180 describe ( 'importing a component when it has a local tag' , ( ) => {
0 commit comments