@@ -51,18 +51,18 @@ describe('SwiftPackage', () => {
51
51
52
52
let pkg ;
53
53
beforeEach ( ( ) => {
54
- fs . mkdirSync ( path . join ( tmpDir . name , 'CordovaPlugins' ) ) ;
55
- fs . writeFileSync ( path . join ( tmpDir . name , 'CordovaPlugins ' , 'Package.swift' ) , fixturePackage , 'utf8' ) ;
54
+ fs . mkdirSync ( path . join ( tmpDir . name , 'packages' , 'cordova-ios-plugins' ) , { recursive : true } ) ;
55
+ fs . writeFileSync ( path . join ( tmpDir . name , 'packages' , 'cordova-ios-plugins ', 'Package.swift' ) , fixturePackage , 'utf8' ) ;
56
56
57
57
pkg = new SwiftPackage ( tmpDir . name ) ;
58
58
} ) ;
59
59
60
60
it ( 'should add plugin references to the package file' , ( ) => {
61
61
pkg . addPlugin ( my_plugin ) ;
62
62
63
- const pkgPath = path . join ( tmpDir . name , 'CordovaPlugins ' , 'Package.swift' ) ;
63
+ const pkgPath = path . join ( tmpDir . name , 'packages' , 'cordova-ios-plugins ', 'Package.swift' ) ;
64
64
const content = fs . readFileSync ( pkgPath , 'utf8' ) ;
65
- expect ( content ) . toContain ( '.package(name: "my-plugin", path: "../packages/ my-plugin")' ) ;
65
+ expect ( content ) . toContain ( '.package(name: "my-plugin", path: "../my-plugin")' ) ;
66
66
expect ( content ) . toContain ( '.product(name: "my-plugin", package: "my-plugin")' ) ;
67
67
} ) ;
68
68
@@ -75,11 +75,11 @@ describe('SwiftPackage', () => {
75
75
it ( 'should add plugin references to the package file when linked' , ( ) => {
76
76
pkg . addPlugin ( my_plugin , { link : true } ) ;
77
77
78
- const pkgPath = path . join ( tmpDir . name , 'CordovaPlugins ' , 'Package.swift' ) ;
78
+ const pkgPath = path . join ( tmpDir . name , 'packages' , 'cordova-ios-plugins ', 'Package.swift' ) ;
79
79
const content = fs . readFileSync ( pkgPath , 'utf8' ) ;
80
80
81
81
expect ( content ) . toContain ( '.package(name: "my-plugin", path: "' ) ;
82
- expect ( content ) . not . toContain ( '.package(name: "my-plugin", path: "../packages/ my-plugin")' ) ;
82
+ expect ( content ) . not . toContain ( '.package(name: "my-plugin", path: "../my-plugin")' ) ;
83
83
expect ( content ) . toContain ( '.product(name: "my-plugin", package: "my-plugin")' ) ;
84
84
} ) ;
85
85
@@ -98,8 +98,8 @@ describe('SwiftPackage', () => {
98
98
99
99
let pkg ;
100
100
beforeEach ( ( ) => {
101
- fs . mkdirSync ( path . join ( tmpDir . name , 'CordovaPlugins' ) ) ;
102
- const pkgPath = path . join ( tmpDir . name , 'CordovaPlugins ' , 'Package.swift' ) ;
101
+ fs . mkdirSync ( path . join ( tmpDir . name , 'packages' , 'cordova-ios-plugins' ) , { recursive : true } ) ;
102
+ const pkgPath = path . join ( tmpDir . name , 'packages' , 'cordova-ios-plugins ', 'Package.swift' ) ;
103
103
fs . writeFileSync ( pkgPath , fixturePackage , 'utf8' ) ;
104
104
105
105
pkg = new SwiftPackage ( tmpDir . name ) ;
@@ -109,7 +109,9 @@ describe('SwiftPackage', () => {
109
109
it ( 'should remove plugin references to the package file' , ( ) => {
110
110
pkg . removePlugin ( my_plugin ) ;
111
111
112
- const content = fs . readFileSync ( path . join ( tmpDir . name , 'CordovaPlugins' , 'Package.swift' ) , 'utf8' ) ;
112
+ const pkgPath = path . join ( tmpDir . name , 'packages' , 'cordova-ios-plugins' , 'Package.swift' ) ;
113
+ const content = fs . readFileSync ( pkgPath , 'utf8' ) ;
114
+
113
115
expect ( content ) . not . toContain ( '.package(name: "my-plugin"' ) ;
114
116
expect ( content ) . not . toContain ( '.product(name: "my-plugin", package: "my-plugin")' ) ;
115
117
} ) ;
0 commit comments