@@ -693,6 +693,7 @@ describe("Plugins service", () => {
693693 newPluginHashes ?: IStringDictionary ;
694694 buildDataFileExists ?: boolean ;
695695 hasPluginPlatformsDir ?: boolean ;
696+ pluginHashesAfterPrepare ?: IStringDictionary ;
696697 } ) : any => {
697698 const testData : any = {
698699 pluginsService : null ,
@@ -730,7 +731,10 @@ describe("Plugins service", () => {
730731 currentPluginNativeHashes : IStringDictionary
731732 ) => ! ! opts . hasChangesInShasums ,
732733 generateHashes : async ( files : string [ ] ) : Promise < IStringDictionary > =>
733- pluginHashes ,
734+ testData . isPreparePluginNativeCodeCalled &&
735+ opts . pluginHashesAfterPrepare
736+ ? opts . pluginHashesAfterPrepare
737+ : pluginHashes ,
734738 } ) ;
735739
736740 unitTestsInjector . register ( "fs" , {
@@ -767,9 +771,8 @@ describe("Plugins service", () => {
767771 unitTestsInjector . register ( "nodeModulesDependenciesBuilder" , { } ) ;
768772 unitTestsInjector . register ( "tempService" , stubs . TempServiceStub ) ;
769773
770- const pluginsService : PluginsService = unitTestsInjector . resolve (
771- PluginsService
772- ) ;
774+ const pluginsService : PluginsService =
775+ unitTestsInjector . resolve ( PluginsService ) ;
773776 testData . pluginsService = pluginsService ;
774777 testData . pluginData = samplePluginData ;
775778 return testData ;
@@ -805,6 +808,25 @@ describe("Plugins service", () => {
805808 } ) ;
806809 } ) ;
807810
811+ it ( "should hash the plugin files after prepare" , async ( ) => {
812+ const newPluginHashes = { file : "hash" } ;
813+ const pluginHashesAfterPrepare = { file : "hasedafterprepare" } ;
814+ const testData = setupTest ( {
815+ newPluginHashes,
816+ hasPluginPlatformsDir : true ,
817+ pluginHashesAfterPrepare,
818+ } ) ;
819+ await testData . pluginsService . preparePluginNativeCode ( {
820+ pluginData : testData . pluginData ,
821+ platform,
822+ projectData,
823+ } ) ;
824+ assert . isTrue ( testData . isPreparePluginNativeCodeCalled ) ;
825+ assert . deepStrictEqual ( testData . dataPassedToWriteJson , {
826+ [ testData . pluginData . name ] : pluginHashesAfterPrepare ,
827+ } ) ;
828+ } ) ;
829+
808830 it ( "does not prepare the files when plugin has platforms dir and files have not changed since then" , async ( ) => {
809831 const testData = setupTest ( {
810832 hasChangesInShasums : false ,
0 commit comments